diff --git a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/package.scala b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/package.scala index d606d86fbb..8f96deca96 100644 --- a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/package.scala +++ b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/package.scala @@ -28,6 +28,7 @@ package object apispec { private[docs] def exampleValue(v: String): ExampleValue = ExampleSingleValue(v) private[docs] def exampleValue[T](codec: Codec[_, T, _], e: T): Option[ExampleValue] = exampleValue(codec.schema, codec.encode(e)) + private[docs] def exampleValue(schema: Schema[_], raw: Any): Option[ExampleValue] = { // #3581: if there's a delimiter and the encoded value is a string, the codec will have produced a final // representation (with the delimiter applied), but in the docs we want to show the split values diff --git a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/TSchemaToASchema.scala b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/TSchemaToASchema.scala index bfbeedf18d..76999a91e7 100644 --- a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/TSchemaToASchema.scala +++ b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/TSchemaToASchema.scala @@ -45,7 +45,7 @@ private[docs] class TSchemaToASchema( // the initial list of schemas. val propagated = propagateMetadataForOption(schema, opt).element val ref = toSchemaReference.map(propagated, name) - if (!markOptionsAsNullable) ref else ref.copy(nullable = Some(true)) + if (!markOptionsAsNullable) ref else ref.nullable case TSchemaType.SOption(el) => apply(el, allowReference = true, isOptionElement = true) case TSchemaType.SBinary() => ASchema(SchemaType.String).copy(format = SchemaFormat.Binary) case TSchemaType.SDate() => ASchema(SchemaType.String).copy(format = SchemaFormat.Date) @@ -58,7 +58,10 @@ private[docs] class TSchemaToASchema( .map(apply(_, allowReference = true)) .sortBy { case schema if schema.$ref.isDefined => schema.$ref.get - case schema => schema.`type`.collect { case t: BasicSchemaType => t.value }.getOrElse("") + schema.toString + case schema => schema.`type`.collect { + case List(t) => t.value + case List(t, SchemaType.Null) => t.value + }.getOrElse("") + schema.toString }, d.map(tDiscriminatorToADiscriminator) ) @@ -82,7 +85,7 @@ private[docs] class TSchemaToASchema( } var s = result - s = if (nullable) s.copy(nullable = Some(true)) else s + s = if (nullable) s.nullable else s s = addMetadata(s, schema) s = addAttributes(s, schema) s = addConstraints(s, primitiveValidators, schemaIsWholeNumber) @@ -111,7 +114,7 @@ private[docs] class TSchemaToASchema( oschema.copy( description = tschema.description.orElse(oschema.description), default = tDefaultToADefault(tschema).orElse(oschema.default), - example = tExampleToAExample(tschema).orElse(oschema.example), + examples = tExampleToAExample(tschema).map(List(_)).orElse(oschema.examples), format = tschema.format.orElse(oschema.format), deprecated = (if (tschema.deprecated) Some(true) else None).orElse(oschema.deprecated), extensions = DocsExtensions.fromIterable(tschema.docsExtensions) @@ -126,16 +129,14 @@ private[docs] class TSchemaToASchema( private def addConstraints(aschema: ASchema, v: Validator.Primitive[_], wholeNumbers: Boolean): ASchema = { v match { - case m @ Validator.Min(v, exclusive) => - aschema.copy( - minimum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers)), - exclusiveMinimum = Option(exclusive).filter(identity) - ) - case m @ Validator.Max(v, exclusive) => - aschema.copy( - maximum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers)), - exclusiveMaximum = Option(exclusive).filter(identity) - ) + case m @ Validator.Min(v, false) => + aschema.copy(minimum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers))) + case m @ Validator.Min(v, true) => + aschema.copy(exclusiveMinimum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers))) + case m @ Validator.Max(v, false) => + aschema.copy(maximum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers))) + case m @ Validator.Max(v, true) => + aschema.copy(exclusiveMaximum = Some(toBigDecimal(v, m.valueIsNumeric, wholeNumbers))) case Validator.Pattern(value) => aschema.copy(pattern = Some(Pattern(value))) case Validator.MinLength(value, _) => aschema.copy(minLength = Some(value)) case Validator.MaxLength(value, _) => aschema.copy(maxLength = Some(value)) diff --git a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/ToSchemaReference.scala b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/ToSchemaReference.scala index 702260dd00..9e93efdc70 100644 --- a/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/ToSchemaReference.scala +++ b/docs/apispec-docs/src/main/scala/sttp/tapir/docs/apispec/schema/ToSchemaReference.scala @@ -19,7 +19,7 @@ private[schema] class ToSchemaReference( // the differently customised properties are reset to their default values in ToKeyedSchemas (#1203) if (originalSchema.description != schema.description) result = result.copy(description = schema.description) if (originalSchema.default != schema.default) result = result.copy(default = tDefaultToADefault(schema)) - if (originalSchema.encodedExample != schema.encodedExample) result = result.copy(example = tExampleToAExample(schema)) + if (originalSchema.encodedExample != schema.encodedExample) result = result.copy(examples = tExampleToAExample(schema).map(List(_))) if (originalSchema.deprecated != schema.deprecated && schema.deprecated) result = result.copy(deprecated = Some(schema.deprecated)) if (originalSchema.attributes.get(Title.Attribute) != schema.attributes.get(Title.Attribute)) result = result.copy(title = schema.attributes.get(Title.Attribute).map(_.value)) diff --git a/docs/asyncapi-docs/src/main/scala/sttp/tapir/docs/asyncapi/EndpointToAsyncAPIWebSocketChannel.scala b/docs/asyncapi-docs/src/main/scala/sttp/tapir/docs/asyncapi/EndpointToAsyncAPIWebSocketChannel.scala index 970d5e9598..d27b17a09c 100644 --- a/docs/asyncapi-docs/src/main/scala/sttp/tapir/docs/asyncapi/EndpointToAsyncAPIWebSocketChannel.scala +++ b/docs/asyncapi-docs/src/main/scala/sttp/tapir/docs/asyncapi/EndpointToAsyncAPIWebSocketChannel.scala @@ -91,7 +91,7 @@ private[asyncapi] class EndpointToAsyncAPIWebSocketChannel( else Some { ASchema( - `type` = Some(ASchemaType.Object), + `type` = Some(List(ASchemaType.Object)), required = fields.collect { case ((name, codec), _) if !codec.schema.isOptional => name }.toList, properties = fields.map { case ((name, _), schema) => name -> schema }.toListMap ) diff --git a/docs/asyncapi-docs/src/test/resources/expected_binding.yml b/docs/asyncapi-docs/src/test/resources/expected_binding.yml index fa33709df3..321b09b2ff 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_binding.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_binding.yml @@ -16,16 +16,16 @@ channels: ws: method: POST query: + type: object required: - multiplier - type: object properties: multiplier: type: string headers: + type: object required: - Authorization - type: object properties: Authorization: type: string @@ -33,9 +33,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_description_header.yml b/docs/asyncapi-docs/src/test/resources/expected_description_header.yml index aae6a7403a..61690ecb42 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_description_header.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_description_header.yml @@ -17,13 +17,13 @@ channels: ws: method: GET headers: + type: object required: - Test - type: object properties: Test: - type: string description: Test token + type: string components: messages: string: diff --git a/docs/asyncapi-docs/src/test/resources/expected_description_query.yml b/docs/asyncapi-docs/src/test/resources/expected_description_query.yml index 561bb2c7e6..a3a71aa990 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_description_query.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_description_query.yml @@ -20,12 +20,12 @@ channels: type: object properties: limit: - type: integer description: GET `limit` field description + type: integer format: int32 offset: - type: integer description: GET `offset` field description + type: integer format: int32 components: messages: diff --git a/docs/asyncapi-docs/src/test/resources/expected_extensions.yml b/docs/asyncapi-docs/src/test/resources/expected_extensions.yml index c9e40f405b..605b0fa99e 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_extensions.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_extensions.yml @@ -33,10 +33,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string @@ -45,9 +45,9 @@ components: format: int32 Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_flags_header.yml b/docs/asyncapi-docs/src/test/resources/expected_flags_header.yml index 9ff24919c9..d9f418f26d 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_flags_header.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_flags_header.yml @@ -16,14 +16,14 @@ channels: ws: method: GET headers: + type: object required: - Test - type: object properties: Test: - type: string description: Test token deprecated: true + type: string components: messages: string: diff --git a/docs/asyncapi-docs/src/test/resources/expected_flags_query.yml b/docs/asyncapi-docs/src/test/resources/expected_flags_query.yml index 7a09422f89..74c7509268 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_flags_query.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_flags_query.yml @@ -16,18 +16,18 @@ channels: ws: method: GET query: + type: object required: - limit - offset - type: object properties: limit: type: integer format: int32 offset: + deprecated: true type: integer format: int32 - deprecated: true components: messages: string: diff --git a/docs/asyncapi-docs/src/test/resources/expected_json_custom_schema_name.yml b/docs/asyncapi-docs/src/test/resources/expected_json_custom_schema_name.yml index 078eb1dffb..1236e697c2 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_json_custom_schema_name.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_json_custom_schema_name.yml @@ -19,9 +19,9 @@ components: schemas: sttp.tapir.tests.data.Fruit: title: sttp.tapir.tests.data.Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_json_examples.yml b/docs/asyncapi-docs/src/test/resources/expected_json_examples.yml index 576fc6ec39..f3be214231 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_json_examples.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_json_examples.yml @@ -19,9 +19,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_json_json.yml b/docs/asyncapi-docs/src/test/resources/expected_json_json.yml index c7d114002e..f420aab774 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_json_json.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_json_json.yml @@ -19,9 +19,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_required_parameters.yml b/docs/asyncapi-docs/src/test/resources/expected_required_parameters.yml index e9da041a5a..4266477781 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_required_parameters.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_required_parameters.yml @@ -16,9 +16,9 @@ channels: ws: method: GET query: + type: object required: - limit - type: object properties: limit: type: integer diff --git a/docs/asyncapi-docs/src/test/resources/expected_security.yml b/docs/asyncapi-docs/src/test/resources/expected_security.yml index 2ba2b99023..370f77e4bb 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_security.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_security.yml @@ -25,9 +25,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_string_json.yml b/docs/asyncapi-docs/src/test/resources/expected_string_json.yml index 27fb0cfaf9..3b213efd06 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_string_json.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_string_json.yml @@ -19,9 +19,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string diff --git a/docs/asyncapi-docs/src/test/resources/expected_two_endpoints.yml b/docs/asyncapi-docs/src/test/resources/expected_two_endpoints.yml index a041e8253f..3b24b293fe 100644 --- a/docs/asyncapi-docs/src/test/resources/expected_two_endpoints.yml +++ b/docs/asyncapi-docs/src/test/resources/expected_two_endpoints.yml @@ -31,18 +31,18 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct.yml index 64e408a124..e343b7f6e7 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct.yml @@ -22,18 +22,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator.yml index 2af61199ea..9cfb4bee8a 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator.yml @@ -27,18 +27,18 @@ components: sml: '#/components/schemas/Organization' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_nested.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_nested.yml index 2c81b14f52..c7a3eaccca 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_nested.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_nested.yml @@ -27,26 +27,26 @@ components: sml: '#/components/schemas/Organization' NestedEntity: title: NestedEntity + type: object required: - entity - type: object properties: entity: $ref: '#/components/schemas/Entity' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_with_enum_circe.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_with_enum_circe.yml index 51222d4f42..b12ded75fa 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_with_enum_circe.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_discriminator_with_enum_circe.yml @@ -25,10 +25,10 @@ components: Square: '#/components/schemas/Square' Square: title: Square + type: object required: - color - shapeType - type: object properties: color: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_independent.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_independent.yml index 1a8623fa65..ef7ba4f4db 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_independent.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_independent.yml @@ -65,10 +65,10 @@ components: person: '#/components/schemas/Person1' Organization: title: Organization + type: object required: - name - kind - type: object properties: name: type: string @@ -76,10 +76,10 @@ components: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string @@ -88,11 +88,11 @@ components: format: int32 Person1: title: Person + type: object required: - name - age - kind - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_nested.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_nested.yml index 478291bbee..926752ba4f 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_nested.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_nested.yml @@ -22,26 +22,26 @@ components: - $ref: '#/components/schemas/Person' NestedEntity: title: NestedEntity + type: object required: - entity - type: object properties: entity: $ref: '#/components/schemas/Entity' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_wrapped.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_wrapped.yml index c703256894..c5e9cac290 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_wrapped.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_coproduct_wrapped.yml @@ -32,32 +32,32 @@ components: Entity: title: Entity oneOf: - - required: + - type: object + required: - Organization - type: object properties: Organization: $ref: '#/components/schemas/Organization' - - required: + - type: object + required: - Person - type: object properties: Person: $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_generic_coproduct.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_generic_coproduct.yml index 32ae41238f..a0496606b3 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_generic_coproduct.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_generic_coproduct.yml @@ -51,18 +51,18 @@ components: - $ref: '#/components/schemas/GenericPerson_String' GenericPerson_Int: title: GenericPerson_Int + type: object required: - data - type: object properties: data: type: integer format: int32 GenericPerson_String: title: GenericPerson_String + type: object required: - data - type: object properties: data: type: string diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_recursive_coproducts.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_recursive_coproducts.yml index 3ac4631a3a..8c2995cfc5 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_recursive_coproducts.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_recursive_coproducts.yml @@ -30,17 +30,17 @@ components: - $ref: '#/components/schemas/Not' Expression: title: Expression + type: object required: - v - type: object properties: v: type: string Not: title: Not + type: object required: - not - type: object properties: not: $ref: '#/components/schemas/Clause' \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/coproduct/expected_unfolded_coproduct_unfolded_array.yml b/docs/openapi-docs/src/test/resources/coproduct/expected_unfolded_coproduct_unfolded_array.yml index f50b902f9a..dbd0cbb481 100644 --- a/docs/openapi-docs/src/test/resources/coproduct/expected_unfolded_coproduct_unfolded_array.yml +++ b/docs/openapi-docs/src/test/resources/coproduct/expected_unfolded_coproduct_unfolded_array.yml @@ -24,18 +24,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/decode_failure_output/expected_json_response_defined_in_options.yml b/docs/openapi-docs/src/test/resources/decode_failure_output/expected_json_response_defined_in_options.yml index c4fb69f96f..4d7bcf3fe9 100644 --- a/docs/openapi-docs/src/test/resources/decode_failure_output/expected_json_response_defined_in_options.yml +++ b/docs/openapi-docs/src/test/resources/decode_failure_output/expected_json_response_defined_in_options.yml @@ -27,9 +27,9 @@ components: schemas: Fail: title: Fail + type: object required: - msg - type: object properties: msg: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enum_in_delimited_query_with_default.yml b/docs/openapi-docs/src/test/resources/enum/expected_enum_in_delimited_query_with_default.yml index b1cb85c456..0a9d38f95a 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enum_in_delimited_query_with_default.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enum_in_delimited_query_with_default.yml @@ -12,12 +12,12 @@ paths: required: false explode: false schema: - type: array - items: - $ref: '#/components/schemas/CornerStyle' default: - rounded - straight + type: array + items: + $ref: '#/components/schemas/CornerStyle' example: - rounded - straight diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_adding_default_when_encoded_value_specified.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_adding_default_when_encoded_value_specified.yml index 8d80cf75bb..290fcd2b6b 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_adding_default_when_encoded_value_specified.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_adding_default_when_encoded_value_specified.yml @@ -42,10 +42,10 @@ components: - PEAR FruitWithEnum: title: FruitWithEnum + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_collection_component.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_collection_component.yml index f9dd37cb87..cb2036fe22 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_collection_component.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_collection_component.yml @@ -24,9 +24,9 @@ components: - LU CountryCollection: title: CountryCollection + type: object required: - countryCode - type: object properties: countryCode: $ref: '#/components/schemas/CountryCode' diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_component.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_component.yml index e7546c1b20..e3cfc0e3b4 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_component.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_component.yml @@ -37,9 +37,9 @@ components: schemas: Belgium: title: Belgium + type: object required: - countryCode - type: object properties: countryCode: $ref: '#/components/schemas/CountryCode' @@ -52,17 +52,17 @@ components: - LU Luxembourg: title: Luxembourg + type: object required: - countryCode - type: object properties: countryCode: $ref: '#/components/schemas/CountryCode' Poland: title: Poland + type: object required: - countryCode - type: object properties: countryCode: $ref: '#/components/schemas/CountryCode' \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_default.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_default.yml index 5ef7c16f04..1c86989ad9 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_default.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_default.yml @@ -13,7 +13,7 @@ paths: schema: $ref: '#/components/schemas/FruitType' default: PEAR - example: APPLE + example: APPLE responses: '200': description: '' @@ -37,10 +37,10 @@ components: - PEAR FruitWithEnum: title: FruitWithEnum + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_not_adding_default_when_no_encoded_value_specified.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_not_adding_default_when_no_encoded_value_specified.yml index fd9474255f..72feb378af 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_not_adding_default_when_no_encoded_value_specified.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_not_adding_default_when_no_encoded_value_specified.yml @@ -41,10 +41,10 @@ components: - PEAR FruitWithEnum: title: FruitWithEnum + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_using_first_specified_default_value.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_using_first_specified_default_value.yml index afb46e645a..f9fa889e40 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_using_first_specified_default_value.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_enum_using_first_specified_default_value.yml @@ -59,10 +59,10 @@ components: - PEAR FruitWithEnum: title: FruitWithEnum + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_int_enum_component.yml b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_int_enum_component.yml index e0449da1fe..4b7a85dda8 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_int_enum_component.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_enumeratum_int_enum_component.yml @@ -27,24 +27,24 @@ components: schemas: Error1Response: title: Error1Response + type: object required: - error - type: object properties: error: $ref: '#/components/schemas/ErrorCode' Error2Response: title: Error2Response + type: object required: - error - type: object properties: error: $ref: '#/components/schemas/ErrorCode' ErrorCode: title: ErrorCode type: integer - format: int32 enum: - 1 - 2 + format: int32 diff --git a/docs/openapi-docs/src/test/resources/enum/expected_trait_enum_component.yml b/docs/openapi-docs/src/test/resources/enum/expected_trait_enum_component.yml index 7c7e043e55..6089010d4c 100644 --- a/docs/openapi-docs/src/test/resources/enum/expected_trait_enum_component.yml +++ b/docs/openapi-docs/src/test/resources/enum/expected_trait_enum_component.yml @@ -27,10 +27,10 @@ components: schemas: CallOfDuty: title: CallOfDuty + type: object required: - game - episode - type: object properties: game: $ref: '#/components/schemas/Game' @@ -47,10 +47,10 @@ components: - strategy TotalWar: title: TotalWar + type: object required: - game - episode - type: object properties: game: $ref: '#/components/schemas/Game' @@ -58,4 +58,4 @@ components: type: string enum: - first - - second \ No newline at end of file + - second diff --git a/docs/openapi-docs/src/test/resources/example/expected_examples_of_list_and_not_list_types.yml b/docs/openapi-docs/src/test/resources/example/expected_examples_of_list_and_not_list_types.yml index 8261a653d7..f3cd501516 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_examples_of_list_and_not_list_types.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_examples_of_list_and_not_list_types.yml @@ -46,10 +46,10 @@ components: schemas: Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples.yml b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples.yml index b540162211..86600506c7 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples.yml @@ -96,18 +96,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_default_names.yml b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_default_names.yml index 34c318496f..407ae28ac5 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_default_names.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_default_names.yml @@ -34,10 +34,10 @@ components: schemas: Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_explicit_and_default_names.yml b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_explicit_and_default_names.yml index 15495a9ad0..8c8f988f9c 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_explicit_and_default_names.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_explicit_and_default_names.yml @@ -34,10 +34,10 @@ components: schemas: Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_names.yml b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_names.yml index d9bcf515c9..c2761baf29 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_names.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_multiple_examples_with_names.yml @@ -34,18 +34,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_schema_example.yml b/docs/openapi-docs/src/test/resources/example/expected_schema_example.yml index 5d71de2dac..cc47b45596 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_schema_example.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_schema_example.yml @@ -10,9 +10,10 @@ paths: content: application/json: schema: + examples: + - '2021-01-01T01:01:01.000000001Z' type: string format: date-time - example: '2021-01-01T01:01:01.000000001Z' required: true responses: '200': @@ -31,10 +32,10 @@ components: schemas: Author: title: Author + type: object required: - name - country - type: object properties: name: type: string @@ -42,12 +43,22 @@ components: $ref: '#/components/schemas/Country' Book: title: Book + examples: + - title: title + genre: + name: name + description: desc + year: 2021 + author: + name: name + country: + name: country + type: object required: - title - genre - year - author - type: object properties: title: type: string @@ -58,30 +69,20 @@ components: format: int32 author: $ref: '#/components/schemas/Author' - example: - title: title - genre: - name: name - description: desc - year: 2021 - author: - name: name - country: - name: country Country: title: Country + type: object required: - name - type: object properties: name: type: string Genre: title: Genre + type: object required: - name - description - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_schema_example_multiple_value.yml b/docs/openapi-docs/src/test/resources/example/expected_schema_example_multiple_value.yml index babb689484..27bcc4d85a 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_schema_example_multiple_value.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_schema_example_multiple_value.yml @@ -28,11 +28,11 @@ components: type: object properties: l: + examples: + - - 1 + - 2 + - 3 type: array items: type: integer format: int32 - example: - - 1 - - 2 - - 3 \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/example/expected_single_example_with_name.yml b/docs/openapi-docs/src/test/resources/example/expected_single_example_with_name.yml index 412208fe00..e672c4d179 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_single_example_with_name.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_single_example_with_name.yml @@ -29,18 +29,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/example/expected_stream_example.yml b/docs/openapi-docs/src/test/resources/example/expected_stream_example.yml index 1918c177b7..5eebdbc07f 100644 --- a/docs/openapi-docs/src/test/resources/example/expected_stream_example.yml +++ b/docs/openapi-docs/src/test/resources/example/expected_stream_example.yml @@ -28,10 +28,10 @@ components: schemas: Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/expected.yml b/docs/openapi-docs/src/test/resources/expected.yml index 2b4d456642..43ffb0ad91 100644 --- a/docs/openapi-docs/src/test/resources/expected.yml +++ b/docs/openapi-docs/src/test/resources/expected.yml @@ -82,10 +82,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_additional_properties.yml b/docs/openapi-docs/src/test/resources/expected_additional_properties.yml index b192a2efb5..3c6986f934 100644 --- a/docs/openapi-docs/src/test/resources/expected_additional_properties.yml +++ b/docs/openapi-docs/src/test/resources/expected_additional_properties.yml @@ -22,10 +22,10 @@ components: $ref: '#/components/schemas/Person' Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_callbacks.yml b/docs/openapi-docs/src/test/resources/expected_callbacks.yml index 9a0088e050..34711c55de 100644 --- a/docs/openapi-docs/src/test/resources/expected_callbacks.yml +++ b/docs/openapi-docs/src/test/resources/expected_callbacks.yml @@ -47,17 +47,17 @@ components: schemas: TriggerRequest: title: TriggerRequest + type: object required: - callbackUrl - type: object properties: callbackUrl: type: string CallbackRequest: title: CallbackRequest + type: object required: - answer - type: object properties: answer: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_custom_schema_name.yml b/docs/openapi-docs/src/test/resources/expected_custom_schema_name.yml index b8c6a9930e..4099c398c8 100644 --- a/docs/openapi-docs/src/test/resources/expected_custom_schema_name.yml +++ b/docs/openapi-docs/src/test/resources/expected_custom_schema_name.yml @@ -82,10 +82,10 @@ components: schemas: sttp.tapir.tests.data.FruitAmount: title: sttp.tapir.tests.data.FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_default_and_example_on_nested_option_field.yml b/docs/openapi-docs/src/test/resources/expected_default_and_example_on_nested_option_field.yml index f1aefdb126..6a6a906859 100644 --- a/docs/openapi-docs/src/test/resources/expected_default_and_example_on_nested_option_field.yml +++ b/docs/openapi-docs/src/test/resources/expected_default_and_example_on_nested_option_field.yml @@ -31,13 +31,13 @@ components: $ref: '#/components/schemas/Nested' Nested: title: Nested + default: + nestedValue: foo + examples: + - nestedValue: foo + type: object required: - nestedValue - type: object properties: nestedValue: type: string - default: - nestedValue: foo - example: - nestedValue: foo diff --git a/docs/openapi-docs/src/test/resources/expected_default_query_param.yml b/docs/openapi-docs/src/test/resources/expected_default_query_param.yml index 434ce65ae8..234fbfe4d5 100644 --- a/docs/openapi-docs/src/test/resources/expected_default_query_param.yml +++ b/docs/openapi-docs/src/test/resources/expected_default_query_param.yml @@ -11,8 +11,8 @@ paths: in: query required: false schema: - type: string default: tom + type: string example: alan responses: '200': diff --git a/docs/openapi-docs/src/test/resources/expected_default_request_body.yml b/docs/openapi-docs/src/test/resources/expected_default_request_body.yml index 6bf6b8a858..4d7e7fb17c 100644 --- a/docs/openapi-docs/src/test/resources/expected_default_request_body.yml +++ b/docs/openapi-docs/src/test/resources/expected_default_request_body.yml @@ -28,9 +28,9 @@ components: type: object properties: name: - type: string default: foo + type: string count: + default: 12 type: integer format: int32 - default: 12 \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/expected_descriptions_in_nested_custom_schemas.yml b/docs/openapi-docs/src/test/resources/expected_descriptions_in_nested_custom_schemas.yml index cef1b6f206..885bc53a59 100644 --- a/docs/openapi-docs/src/test/resources/expected_descriptions_in_nested_custom_schemas.yml +++ b/docs/openapi-docs/src/test/resources/expected_descriptions_in_nested_custom_schemas.yml @@ -19,22 +19,22 @@ components: schemas: FruitAmount: title: FruitAmount + description: Amount of fruits + type: object required: - fruit - amount - type: object properties: fruit: type: string amount: type: integer format: int32 - description: Amount of fruits ObjectWrapper: title: ObjectWrapper + type: object required: - value - type: object properties: value: $ref: '#/components/schemas/FruitAmount' diff --git a/docs/openapi-docs/src/test/resources/expected_enumeration_values.yml b/docs/openapi-docs/src/test/resources/expected_enumeration_values.yml index 9b8d1b4942..030c17fb06 100644 --- a/docs/openapi-docs/src/test/resources/expected_enumeration_values.yml +++ b/docs/openapi-docs/src/test/resources/expected_enumeration_values.yml @@ -25,9 +25,9 @@ components: schemas: Number: title: Number + type: object required: - value - type: object properties: value: $ref: '#/components/schemas/Numbers' diff --git a/docs/openapi-docs/src/test/resources/expected_extensions.yml b/docs/openapi-docs/src/test/resources/expected_extensions.yml index fe961e8382..8dca93a1d9 100644 --- a/docs/openapi-docs/src/test/resources/expected_extensions.yml +++ b/docs/openapi-docs/src/test/resources/expected_extensions.yml @@ -59,10 +59,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_extensions_schema.yml b/docs/openapi-docs/src/test/resources/expected_extensions_schema.yml index 47742d60c1..edc59097df 100644 --- a/docs/openapi-docs/src/test/resources/expected_extensions_schema.yml +++ b/docs/openapi-docs/src/test/resources/expected_extensions_schema.yml @@ -25,10 +25,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_fields_with_additional_properties.yml b/docs/openapi-docs/src/test/resources/expected_fields_with_additional_properties.yml index 980d9e1d45..c4aa11e8c1 100644 --- a/docs/openapi-docs/src/test/resources/expected_fields_with_additional_properties.yml +++ b/docs/openapi-docs/src/test/resources/expected_fields_with_additional_properties.yml @@ -17,10 +17,10 @@ components: schemas: FailureInput: title: FailureInput + type: object required: - status - message - type: object properties: status: type: integer diff --git a/docs/openapi-docs/src/test/resources/expected_full_schema_names.yml b/docs/openapi-docs/src/test/resources/expected_full_schema_names.yml index 1c26d2d6e2..7c8d283d05 100644 --- a/docs/openapi-docs/src/test/resources/expected_full_schema_names.yml +++ b/docs/openapi-docs/src/test/resources/expected_full_schema_names.yml @@ -22,10 +22,10 @@ components: $ref: '#/components/schemas/sttp_tapir_tests_data_FruitAmount' sttp_tapir_tests_data_FruitAmount: title: sttp_tapir_tests_data_FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_generic.yml b/docs/openapi-docs/src/test/resources/expected_generic.yml index edc2a4171f..ca07aae424 100644 --- a/docs/openapi-docs/src/test/resources/expected_generic.yml +++ b/docs/openapi-docs/src/test/resources/expected_generic.yml @@ -43,18 +43,18 @@ components: schemas: G_Int: title: G_Int + type: object required: - data - type: object properties: data: type: integer format: int32 G_String: title: G_String + type: object required: - data - type: object properties: data: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/expected_json_query_param.yml b/docs/openapi-docs/src/test/resources/expected_json_query_param.yml index cccafb448b..e506748af1 100644 --- a/docs/openapi-docs/src/test/resources/expected_json_query_param.yml +++ b/docs/openapi-docs/src/test/resources/expected_json_query_param.yml @@ -13,8 +13,8 @@ paths: content: application/json: schema: - type: string default: tom + type: string example: alan responses: '200': diff --git a/docs/openapi-docs/src/test/resources/expected_multipart.yml b/docs/openapi-docs/src/test/resources/expected_multipart.yml index b6a8c0cbb9..304b85497a 100644 --- a/docs/openapi-docs/src/test/resources/expected_multipart.yml +++ b/docs/openapi-docs/src/test/resources/expected_multipart.yml @@ -29,9 +29,9 @@ components: schemas: FruitData: title: FruitData + type: object required: - data - type: object properties: data: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field.yml b/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field.yml index 15c75e1418..e2ba7bbdbf 100644 --- a/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field.yml +++ b/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field.yml @@ -29,21 +29,21 @@ components: schemas: Bar: title: Bar + type: object required: - bar - type: object properties: bar: type: integer format: int32 ClassWithOptionClassField: title: ClassWithOptionClassField + type: object required: - requiredStringField - type: object properties: optionalObjField: - oneOf: + anyOf: - $ref: '#/components/schemas/Bar' - type: 'null' requiredStringField: diff --git a/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field_303.yml b/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field_303.yml index 34b488dbe1..a2e3632cb4 100644 --- a/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field_303.yml +++ b/docs/openapi-docs/src/test/resources/expected_nullable_option_class_field_303.yml @@ -29,22 +29,22 @@ components: schemas: Bar: title: Bar + type: object required: - bar - type: object properties: bar: type: integer format: int32 ClassWithOptionClassField: title: ClassWithOptionClassField + type: object required: - requiredStringField - type: object properties: optionalObjField: + nullable: true allOf: - $ref: '#/components/schemas/Bar' - nullable: true requiredStringField: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_nullable_option_field.yml b/docs/openapi-docs/src/test/resources/expected_nullable_option_field.yml index ae40c7a737..bdac68652e 100644 --- a/docs/openapi-docs/src/test/resources/expected_nullable_option_field.yml +++ b/docs/openapi-docs/src/test/resources/expected_nullable_option_field.yml @@ -29,9 +29,9 @@ components: schemas: ClassWithOptionField: title: ClassWithOptionField + type: object required: - requiredStringField - type: object properties: optionalIntField: type: diff --git a/docs/openapi-docs/src/test/resources/expected_nullable_option_field_303.yml b/docs/openapi-docs/src/test/resources/expected_nullable_option_field_303.yml index 54a8fd620b..c4baab0bc4 100644 --- a/docs/openapi-docs/src/test/resources/expected_nullable_option_field_303.yml +++ b/docs/openapi-docs/src/test/resources/expected_nullable_option_field_303.yml @@ -29,13 +29,13 @@ components: schemas: ClassWithOptionField: title: ClassWithOptionField + type: object required: - requiredStringField - type: object properties: optionalIntField: type: integer - format: int32 nullable: true + format: int32 requiredStringField: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_same_fullnames.yml b/docs/openapi-docs/src/test/resources/expected_same_fullnames.yml index cf8f1fca5c..6336e96178 100644 --- a/docs/openapi-docs/src/test/resources/expected_same_fullnames.yml +++ b/docs/openapi-docs/src/test/resources/expected_same_fullnames.yml @@ -29,17 +29,17 @@ components: schemas: Pet: title: Pet + type: object required: - name - type: object properties: name: type: string Pet1: title: Pet + type: object required: - legsCount - type: object properties: legsCount: type: integer diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_array.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_array.yml index a54e0a7504..579e9010af 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_array.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_array.yml @@ -31,10 +31,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_array_unfolded_object.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_array_unfolded_object.yml index dabfd16fa7..0ab3fafa7e 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_array_unfolded_object.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_array_unfolded_object.yml @@ -17,10 +17,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_array_with_unique_items.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_array_with_unique_items.yml index 076d346d3f..a74072d016 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_array_with_unique_items.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_array_with_unique_items.yml @@ -17,10 +17,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string @@ -33,6 +33,6 @@ components: properties: data: type: array + uniqueItems: true items: $ref: '#/components/schemas/FruitAmount' - uniqueItems: true diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_hierarchy.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_hierarchy.yml index 36a870bba2..3523a8e364 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_hierarchy.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_hierarchy.yml @@ -29,10 +29,10 @@ components: schemas: Author: title: Author + type: object required: - name - country - type: object properties: name: type: string @@ -40,12 +40,12 @@ components: $ref: '#/components/schemas/Country' Book: title: Book + type: object required: - title - genre - year - author - type: object properties: title: type: string @@ -58,18 +58,18 @@ components: $ref: '#/components/schemas/Author' Country: title: Country + type: object required: - name - type: object properties: name: type: string Genre: title: Genre + type: object required: - name - description - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_object_unfolded_array.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_object_unfolded_array.yml index 70bbcf9992..0b1e1cd650 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_object_unfolded_array.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_object_unfolded_array.yml @@ -19,10 +19,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string @@ -31,9 +31,9 @@ components: format: int32 ObjectWrapper: title: ObjectWrapper + type: object required: - value - type: object properties: value: $ref: '#/components/schemas/FruitAmount' \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_option.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_option.yml index 7e675e53da..348a3d7944 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_option.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_option.yml @@ -25,10 +25,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/expected_unfolded_option_description.yml b/docs/openapi-docs/src/test/resources/expected_unfolded_option_description.yml index 33844455f6..8c9017b0f1 100644 --- a/docs/openapi-docs/src/test/resources/expected_unfolded_option_description.yml +++ b/docs/openapi-docs/src/test/resources/expected_unfolded_option_description.yml @@ -25,17 +25,17 @@ components: schemas: FruitAmount: title: FruitAmount + description: Amount of fruits + type: object required: - fruit - amount - type: object properties: fruit: type: string amount: type: integer format: int32 - description: Amount of fruits ObjectWithOption: title: ObjectWithOption type: object diff --git a/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_array_field.yml b/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_array_field.yml index 860dfcf6df..bf4c860d9f 100644 --- a/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_array_field.yml +++ b/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_array_field.yml @@ -25,9 +25,9 @@ components: schemas: Data1: title: Data1 + type: object required: - x - type: object properties: x: type: string @@ -40,7 +40,7 @@ components: items: $ref: '#/components/schemas/Data1' field2: + deprecated: true type: array items: $ref: '#/components/schemas/Data1' - deprecated: true \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_optional_field.yml b/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_optional_field.yml index e61c05f2f6..dd90e1a814 100644 --- a/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_optional_field.yml +++ b/docs/openapi-docs/src/test/resources/multi_customise_schema/expected_deprecated_optional_field.yml @@ -25,17 +25,17 @@ components: schemas: Data1: title: Data1 + type: object required: - x - type: object properties: x: type: string HasOptionalDeprecated: title: HasOptionalDeprecated + type: object required: - field1 - type: object properties: field1: $ref: '#/components/schemas/Data1' diff --git a/docs/openapi-docs/src/test/resources/multi_customise_schema/inlined.yml b/docs/openapi-docs/src/test/resources/multi_customise_schema/inlined.yml index 7c11827bdb..d5b69b5406 100644 --- a/docs/openapi-docs/src/test/resources/multi_customise_schema/inlined.yml +++ b/docs/openapi-docs/src/test/resources/multi_customise_schema/inlined.yml @@ -25,25 +25,25 @@ components: schemas: Data2: title: Data2 + type: object required: - a - b - type: object properties: a: + description: aaa + deprecated: true + type: object required: - x - type: object properties: x: type: string - description: aaa - deprecated: true b: + description: bbb + type: object required: - x - type: object properties: x: type: string - description: bbb \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/multi_customise_schema/nested_body.yml b/docs/openapi-docs/src/test/resources/multi_customise_schema/nested_body.yml index 4b21afa9f9..a4bbefc7ea 100644 --- a/docs/openapi-docs/src/test/resources/multi_customise_schema/nested_body.yml +++ b/docs/openapi-docs/src/test/resources/multi_customise_schema/nested_body.yml @@ -25,18 +25,18 @@ components: schemas: Data1: title: Data1 + type: object required: - x - type: object properties: x: type: string Data2: title: Data2 + type: object required: - a - b - type: object properties: a: $ref: '#/components/schemas/Data1' diff --git a/docs/openapi-docs/src/test/resources/multi_customise_schema/top_level_body.yml b/docs/openapi-docs/src/test/resources/multi_customise_schema/top_level_body.yml index cffd34d79b..fa9eb6f387 100644 --- a/docs/openapi-docs/src/test/resources/multi_customise_schema/top_level_body.yml +++ b/docs/openapi-docs/src/test/resources/multi_customise_schema/top_level_body.yml @@ -31,9 +31,9 @@ components: schemas: Data1: title: Data1 + type: object required: - x - type: object properties: x: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_common_schema.yml b/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_common_schema.yml index 39bcd7f456..d68002c627 100644 --- a/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_common_schema.yml +++ b/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_common_schema.yml @@ -35,9 +35,9 @@ components: schemas: Organization: title: Organization + type: object required: - name - type: object properties: name: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_different_schema.yml b/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_different_schema.yml index ed1a7cde63..8f19f5524d 100644 --- a/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_different_schema.yml +++ b/docs/openapi-docs/src/test/resources/oneOf/expected_multiple_media_types_different_schema.yml @@ -32,18 +32,18 @@ components: schemas: Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/oneOf/expected_status_codes.yml b/docs/openapi-docs/src/test/resources/oneOf/expected_status_codes.yml index 439e430e3b..fe32903250 100644 --- a/docs/openapi-docs/src/test/resources/oneOf/expected_status_codes.yml +++ b/docs/openapi-docs/src/test/resources/oneOf/expected_status_codes.yml @@ -31,26 +31,26 @@ components: schemas: NotFound: title: NotFound + type: object required: - what - type: object properties: what: type: string Unauthorized: title: Unauthorized + type: object required: - realm - type: object properties: realm: type: string Unknown: title: Unknown + type: object required: - code - msg - type: object properties: code: type: integer diff --git a/docs/openapi-docs/src/test/resources/oneOf/expected_the_same_status_codes.yml b/docs/openapi-docs/src/test/resources/oneOf/expected_the_same_status_codes.yml index b61e9d767a..970585d1c3 100644 --- a/docs/openapi-docs/src/test/resources/oneOf/expected_the_same_status_codes.yml +++ b/docs/openapi-docs/src/test/resources/oneOf/expected_the_same_status_codes.yml @@ -26,18 +26,18 @@ components: schemas: NotFound: title: NotFound + type: object required: - what - type: object properties: what: type: string Unknown: title: Unknown + type: object required: - code - msg - type: object properties: code: type: integer diff --git a/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_text_range.yml b/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_text_range.yml index aace6d1060..f7355c5790 100644 --- a/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_text_range.yml +++ b/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_text_range.yml @@ -32,9 +32,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_xml_text.yml b/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_xml_text.yml index bec1c32e10..bfbd9ad237 100644 --- a/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_xml_text.yml +++ b/docs/openapi-docs/src/test/resources/oneOfBody/expected_in_json_xml_text.yml @@ -35,9 +35,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/oneOfBody/expected_out_json_xml_text.yml b/docs/openapi-docs/src/test/resources/oneOfBody/expected_out_json_xml_text.yml index 5903bf1afd..204b937af3 100644 --- a/docs/openapi-docs/src/test/resources/oneOfBody/expected_out_json_xml_text.yml +++ b/docs/openapi-docs/src/test/resources/oneOfBody/expected_out_json_xml_text.yml @@ -35,9 +35,9 @@ components: schemas: Fruit: title: Fruit + type: object required: - f - type: object properties: f: type: string \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_additional_properties.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_additional_properties.yml index a3155c0b08..a8a07277ed 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_additional_properties.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_additional_properties.yml @@ -30,10 +30,10 @@ components: $ref: '#/components/schemas/ValidFruitAmount' ValidFruitAmount: title: ValidFruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_collection.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_collection.yml index 2fbd01a049..f1d0231176 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_collection.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_collection.yml @@ -29,15 +29,15 @@ components: properties: fruits: type: array + minItems: 1 items: $ref: '#/components/schemas/ValidFruitAmount' - minItems: 1 ValidFruitAmount: title: ValidFruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_enum.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_enum.yml index 152e61a00f..45d0da01ba 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_enum.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_enum.yml @@ -31,9 +31,9 @@ components: - red ColorWrapper: title: ColorWrapper + type: object required: - color - type: object properties: color: $ref: '#/components/schemas/Color' \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_wrapped.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_wrapped.yml index bfbf0a06a4..631ffd8924 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_body_wrapped.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_body_wrapped.yml @@ -25,10 +25,10 @@ components: schemas: ValidFruitAmount: title: ValidFruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_coproduct.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_coproduct.yml index b5b32c6fda..6f51f4092b 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_coproduct.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_coproduct.yml @@ -22,18 +22,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_cats_nel.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_cats_nel.yml index bc27038523..4985acb644 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_cats_nel.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_cats_nel.yml @@ -11,12 +11,12 @@ paths: application/json: schema: type: array + minItems: 1 items: type: string enum: - blue - red - minItems: 1 required: true responses: '200': diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_object.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_object.yml index 9d1583e7e0..7ba052693c 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_object.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_object.yml @@ -17,10 +17,10 @@ components: schemas: ColorValue: title: ColorValue + type: object required: - color - value - type: object properties: color: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_values.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_values.yml index 8ec45f99f2..cc4f4319b9 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_values.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_enum_values.yml @@ -12,10 +12,10 @@ paths: required: true schema: type: integer - format: int32 enum: - 1 - 2 + format: int32 responses: '200': description: '' diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum.yml index c16ac407ef..7829b87590 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum.yml @@ -23,10 +23,10 @@ components: - PEAR FruitWithEnum: title: FruitWithEnum + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum_with_metadata.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum_with_metadata.yml index 82d3e328d8..2ba51d562b 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum_with_metadata.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_enumeratum_with_metadata.yml @@ -25,22 +25,22 @@ components: schemas: MyNumber: title: MyNumber - type: integer description: |- * 1 - One * 2 - Two * 3 - Three - format: int32 + type: integer enum: - 1 - 2 - 3 + format: int32 NumberWithMsg: title: NumberWithMsg + type: object required: - number - msg - type: object properties: number: $ref: '#/components/schemas/MyNumber' diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_objects.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_objects.yml index 42cce38514..1fa8e54f06 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_objects.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_objects.yml @@ -17,10 +17,10 @@ components: schemas: FruitAmount: title: FruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string @@ -33,6 +33,6 @@ components: properties: data: type: array + maxItems: 1 items: $ref: '#/components/schemas/FruitAmount' - maxItems: 1 \ No newline at end of file diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_strings.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_strings.yml index c547a5b894..29b4d60065 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_strings.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_modified_array_strings.yml @@ -21,6 +21,6 @@ components: properties: data: type: array + maxItems: 1 items: type: string - maxItems: 1 diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_body_wrapped.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_body_wrapped.yml index de4fcd3e03..511434bca5 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_body_wrapped.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_body_wrapped.yml @@ -25,10 +25,10 @@ components: schemas: ValidFruitAmount: title: ValidFruitAmount + type: object required: - fruit - amount - type: object properties: fruit: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_coproduct.yml b/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_coproduct.yml index aabe68f0f5..60e6d476bf 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_coproduct.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_valid_optional_coproduct.yml @@ -30,18 +30,18 @@ components: - $ref: '#/components/schemas/Person' Organization: title: Organization + type: object required: - name - type: object properties: name: type: string Person: title: Person + type: object required: - name - age - type: object properties: name: type: string diff --git a/docs/openapi-docs/src/test/resources/validator/expected_validator_infer_encode_to_raw.yml b/docs/openapi-docs/src/test/resources/validator/expected_validator_infer_encode_to_raw.yml index 4102f1c5e9..3be473cf17 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_validator_infer_encode_to_raw.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_validator_infer_encode_to_raw.yml @@ -14,10 +14,10 @@ paths: type: array items: type: integer - format: int32 enum: - 1 - 2 + format: int32 responses: '200': description: '' diff --git a/docs/openapi-docs/src/test/resources/validator/expected_validator_with_custom_naming.yml b/docs/openapi-docs/src/test/resources/validator/expected_validator_with_custom_naming.yml index 3d73377fec..a8bf5db9a4 100644 --- a/docs/openapi-docs/src/test/resources/validator/expected_validator_with_custom_naming.yml +++ b/docs/openapi-docs/src/test/resources/validator/expected_validator_with_custom_naming.yml @@ -25,9 +25,9 @@ components: schemas: MyClass: title: MyClass + type: object required: - my_attribute - type: object properties: my_attribute: type: integer diff --git a/project/Versions.scala b/project/Versions.scala index c727612f9d..beeca0e176 100644 --- a/project/Versions.scala +++ b/project/Versions.scala @@ -11,7 +11,7 @@ object Versions { val sttp = "3.9.5" val sttpModel = "1.7.9" val sttpShared = "1.3.17" - val sttpApispec = "0.8.0" + val sttpApispec = "0.9.0" val akkaHttp = "10.2.10" val akkaStreams = "2.6.20" val pekkoHttp = "1.0.1"