Skip to content

Commit 84e42a0

Browse files
Kamil Klochkamilkloch
Kamil Kloch
authored andcommitted
Removed methods for binary compatibility.
1 parent 1e852d1 commit 84e42a0

File tree

1 file changed

+88
-88
lines changed

1 file changed

+88
-88
lines changed

core/src/main/scala/sttp/tapir/Schema.scala

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -40,83 +40,83 @@ case class Schema[T](
4040
hidden: Boolean = false,
4141
validator: Validator[T] = Validator.pass[T],
4242
attributes: AttributeMap = AttributeMap.Empty,
43-
// The default value together with the value encoded to a raw format, which will then be directly rendered in the
43+
// The const value together with the value encoded to a raw format, which will then be directly rendered in the
4444
// documentation. This is needed as codecs for nested types aren't available. Similar to Validator.EncodeToRaw
4545
const: Option[(T, Option[Any])] = None
4646
) extends SchemaMacros[T] {
4747

4848
// required for binary compatibility
49-
def this(
50-
schemaType: SchemaType[T],
51-
name: Option[SName],
52-
isOptional: Boolean,
53-
description: Option[String],
54-
default: Option[(T, Option[Any])],
55-
format: Option[String],
56-
encodedExample: Option[Any],
57-
deprecated: Boolean,
58-
hidden: Boolean,
59-
validator: Validator[T],
60-
attributes: AttributeMap
61-
) =
62-
this(schemaType, name, isOptional, description, default, format, encodedExample, deprecated, hidden, validator, attributes, None)
63-
64-
def copy(
65-
schemaType: SchemaType[T] = this.schemaType,
66-
name: Option[SName] = this.name,
67-
isOptional: Boolean = this.isOptional,
68-
description: Option[String] = this.description,
69-
default: Option[(T, Option[Any])] = this.default,
70-
format: Option[String] = this.format,
71-
encodedExample: Option[Any] = this.encodedExample,
72-
deprecated: Boolean = this.deprecated,
73-
hidden: Boolean = this.hidden,
74-
validator: Validator[T] = this.validator,
75-
attributes: AttributeMap = this.attributes,
76-
const: Option[(T, Option[Any])] = this.const
77-
): Schema[T] = new Schema(
78-
schemaType,
79-
name,
80-
isOptional,
81-
description,
82-
default,
83-
format,
84-
encodedExample,
85-
deprecated,
86-
hidden,
87-
validator,
88-
attributes,
89-
const
90-
)
91-
92-
// required for binary compatibility
93-
def copy(
94-
schemaType: SchemaType[T],
95-
name: Option[SName],
96-
isOptional: Boolean,
97-
description: Option[String],
98-
default: Option[(T, Option[Any])],
99-
format: Option[String],
100-
encodedExample: Option[Any],
101-
deprecated: Boolean,
102-
hidden: Boolean,
103-
validator: Validator[T],
104-
attributes: AttributeMap
105-
): Schema[T] =
106-
new Schema(
107-
schemaType,
108-
name,
109-
isOptional,
110-
description,
111-
default,
112-
format,
113-
encodedExample,
114-
deprecated,
115-
hidden,
116-
validator,
117-
attributes,
118-
this.const
119-
)
49+
// def this(
50+
// schemaType: SchemaType[T],
51+
// name: Option[SName],
52+
// isOptional: Boolean,
53+
// description: Option[String],
54+
// default: Option[(T, Option[Any])],
55+
// format: Option[String],
56+
// encodedExample: Option[Any],
57+
// deprecated: Boolean,
58+
// hidden: Boolean,
59+
// validator: Validator[T],
60+
// attributes: AttributeMap
61+
// ) =
62+
// this(schemaType, name, isOptional, description, default, format, encodedExample, deprecated, hidden, validator, attributes, None)
63+
64+
// def copy(
65+
// schemaType: SchemaType[T] = this.schemaType,
66+
// name: Option[SName] = this.name,
67+
// isOptional: Boolean = this.isOptional,
68+
// description: Option[String] = this.description,
69+
// default: Option[(T, Option[Any])] = this.default,
70+
// format: Option[String] = this.format,
71+
// encodedExample: Option[Any] = this.encodedExample,
72+
// deprecated: Boolean = this.deprecated,
73+
// hidden: Boolean = this.hidden,
74+
// validator: Validator[T] = this.validator,
75+
// attributes: AttributeMap = this.attributes,
76+
// const: Option[(T, Option[Any])] = this.const
77+
// ): Schema[T] = new Schema(
78+
// schemaType,
79+
// name,
80+
// isOptional,
81+
// description,
82+
// default,
83+
// format,
84+
// encodedExample,
85+
// deprecated,
86+
// hidden,
87+
// validator,
88+
// attributes,
89+
// const
90+
// )
91+
92+
// // required for binary compatibility
93+
// def copy(
94+
// schemaType: SchemaType[T],
95+
// name: Option[SName],
96+
// isOptional: Boolean,
97+
// description: Option[String],
98+
// default: Option[(T, Option[Any])],
99+
// format: Option[String],
100+
// encodedExample: Option[Any],
101+
// deprecated: Boolean,
102+
// hidden: Boolean,
103+
// validator: Validator[T],
104+
// attributes: AttributeMap
105+
// ): Schema[T] =
106+
// new Schema(
107+
// schemaType,
108+
// name,
109+
// isOptional,
110+
// description,
111+
// default,
112+
// format,
113+
// encodedExample,
114+
// deprecated,
115+
// hidden,
116+
// validator,
117+
// attributes,
118+
// this.const
119+
// )
120120

121121
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT] = Schema(
122122
schemaType = schemaType.contramap(g),
@@ -337,21 +337,21 @@ case class Schema[T](
337337
}
338338

339339
object Schema extends LowPrioritySchema with SchemaCompanionMacros {
340-
// required for binary compatibility
341-
def apply[T](
342-
schemaType: SchemaType[T],
343-
name: Option[SName],
344-
isOptional: Boolean,
345-
description: Option[String],
346-
default: Option[(T, Option[Any])],
347-
format: Option[String],
348-
encodedExample: Option[Any],
349-
deprecated: Boolean,
350-
hidden: Boolean,
351-
validator: Validator[T],
352-
attributes: AttributeMap
353-
): Schema[T] =
354-
new Schema(schemaType, name, isOptional, description, default, format, encodedExample, deprecated, hidden, validator, attributes, None)
340+
// // required for binary compatibility
341+
// def apply[T](
342+
// schemaType: SchemaType[T],
343+
// name: Option[SName],
344+
// isOptional: Boolean,
345+
// description: Option[String],
346+
// default: Option[(T, Option[Any])],
347+
// format: Option[String],
348+
// encodedExample: Option[Any],
349+
// deprecated: Boolean,
350+
// hidden: Boolean,
351+
// validator: Validator[T],
352+
// attributes: AttributeMap
353+
// ): Schema[T] =
354+
// new Schema(schemaType, name, isOptional, description, default, format, encodedExample, deprecated, hidden, validator, attributes, None)
355355

356356
val ModifyCollectionElements = "each"
357357

@@ -405,7 +405,7 @@ object Schema extends LowPrioritySchema with SchemaCompanionMacros {
405405

406406
implicit def schemaForEither[A, B](implicit sa: Schema[A], sb: Schema[B]): Schema[Either[A, B]] = {
407407
Schema[Either[A, B]](
408-
SchemaType.SCoproduct(List(sa, sb), None) {
408+
SchemaType.SCoproduct[Either[A, B]](List(sa, sb), None) {
409409
case Left(v) => Some(SchemaWithValue(sa, v))
410410
case Right(v) => Some(SchemaWithValue(sb, v))
411411
},

0 commit comments

Comments
 (0)