@@ -40,83 +40,83 @@ case class Schema[T](
40
40
hidden : Boolean = false ,
41
41
validator : Validator [T ] = Validator .pass[T ],
42
42
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
44
44
// documentation. This is needed as codecs for nested types aren't available. Similar to Validator.EncodeToRaw
45
45
const : Option [(T , Option [Any ])] = None
46
46
) extends SchemaMacros [T ] {
47
47
48
48
// 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
+ // )
120
120
121
121
def map [TT ](f : T => Option [TT ])(g : TT => T ): Schema [TT ] = Schema (
122
122
schemaType = schemaType.contramap(g),
@@ -337,21 +337,21 @@ case class Schema[T](
337
337
}
338
338
339
339
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)
355
355
356
356
val ModifyCollectionElements = " each"
357
357
@@ -405,7 +405,7 @@ object Schema extends LowPrioritySchema with SchemaCompanionMacros {
405
405
406
406
implicit def schemaForEither [A , B ](implicit sa : Schema [A ], sb : Schema [B ]): Schema [Either [A , B ]] = {
407
407
Schema [Either [A , B ]](
408
- SchemaType .SCoproduct (List (sa, sb), None ) {
408
+ SchemaType .SCoproduct [ Either [ A , B ]] (List (sa, sb), None ) {
409
409
case Left (v) => Some (SchemaWithValue (sa, v))
410
410
case Right (v) => Some (SchemaWithValue (sb, v))
411
411
},
0 commit comments