From fc92e36bb1458928ef562a1e5a1398325e3d0eb8 Mon Sep 17 00:00:00 2001 From: William Cheng <wing328hk@gmail.com> Date: Thu, 29 Nov 2018 19:04:09 +0800 Subject: [PATCH 1/6] update parser and core to latest version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index af2a2359f13..5150740edc5 100644 --- a/pom.xml +++ b/pom.xml @@ -1341,8 +1341,8 @@ <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> - <swagger-parser-version>2.0.4</swagger-parser-version> - <swagger-core-version>2.0.4</swagger-core-version> + <swagger-parser-version>2.0.6</swagger-parser-version> + <swagger-core-version>2.0.5</swagger-core-version> <scala-version>2.11.1</scala-version> <felix-version>3.3.1</felix-version> <commons-io-version>2.4</commons-io-version> -- GitLab From ba7e7d577e2fa6a43243c008dca8f7366ce4da81 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson <dev@jmini.fr> Date: Mon, 10 Dec 2018 16:59:27 +0100 Subject: [PATCH 2/6] Update swagger-parser to 2.0.7 and swagger-core to 2.0.6 Conflicts: pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 70e2cfed3eb..08212253aa8 100644 --- a/pom.xml +++ b/pom.xml @@ -1341,8 +1341,8 @@ <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> - <swagger-parser-version>2.0.6</swagger-parser-version> - <swagger-core-version>2.0.5</swagger-core-version> + <swagger-parser-version>2.0.7</swagger-parser-version> + <swagger-core-version>2.0.6</swagger-core-version> <scala-version>2.11.1</scala-version> <felix-version>3.3.1</felix-version> <commons-io-version>2.4</commons-io-version> -- GitLab From 347a4e80b8ca6d7cbd4d2e71db1f2a7ff62d695c Mon Sep 17 00:00:00 2001 From: Jeremie Bresson <dev@jmini.fr> Date: Mon, 10 Dec 2018 17:07:06 +0100 Subject: [PATCH 3/6] Use LinkedHashMap instead of HashMap HashMap is not stable beetween 'Java 8' and 'Java 11' --- .../codegen/serializer/SerializerUtilsTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java index 88dd873d32d..1f44c0932cc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java @@ -19,6 +19,7 @@ import io.swagger.v3.oas.models.tags.Tag; import org.testng.annotations.Test; import java.util.Arrays; +import java.util.LinkedHashMap; public class SerializerUtilsTest { @@ -44,6 +45,7 @@ public class SerializerUtilsTest { .operationId("pingOp") .responses(new ApiResponses().addApiResponse("200", new ApiResponse().description("Ok"))))); openAPI.components(new Components().addSchemas("SomeObject", new ObjectSchema().description("An Obj").addProperties("id", new StringSchema()))); + openAPI.setExtensions(new LinkedHashMap<>()); // required because swagger-core is using HashMap instead of LinkedHashMap internally. openAPI.addExtension("x-custom", "value1"); openAPI.addExtension("x-other", "value2"); @@ -87,8 +89,8 @@ public class SerializerUtilsTest { " id:\n" + " type: string\n" + " type: object\n" + - "x-other: value2\n" + - "x-custom: value1\n"; + "x-custom: value1\n" + + "x-other: value2\n"; assertEquals(content, expected); } -- GitLab From 8e1bc4c4adb9324f1adf8112cae3d5bb0dac90f5 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson <dev@jmini.fr> Date: Mon, 10 Dec 2018 17:44:30 +0100 Subject: [PATCH 4/6] Add test case for referenced callbacks during unused schemas computation It was not possible to add it in #1232 because of issue https://github.com/swagger-api/swagger-parser/issues/879 --- .../codegen/utils/ModelUtilsTest.java | 4 +- .../src/test/resources/3_0/unusedSchemas.yaml | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java index 16951a91b5d..a9ab3f0172e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java @@ -44,7 +44,7 @@ public class ModelUtilsTest { public void testGetAllUsedSchemas() { final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/unusedSchemas.yaml", null, new ParseOptions()).getOpenAPI(); List<String> allUsedSchemas = ModelUtils.getAllUsedSchemas(openAPI); - Assert.assertEquals(allUsedSchemas.size(), 30); + Assert.assertEquals(allUsedSchemas.size(), 32); Assert.assertTrue(allUsedSchemas.contains("SomeObjShared"), "contains 'SomeObjShared'"); Assert.assertTrue(allUsedSchemas.contains("SomeObj1"), "contains 'UnusedObj1'"); @@ -76,6 +76,8 @@ public class ModelUtilsTest { Assert.assertTrue(allUsedSchemas.contains("OtherObj20"), "contains 'OtherObj20'"); Assert.assertTrue(allUsedSchemas.contains("PingDataInput21"), "contains 'PingDataInput21'"); Assert.assertTrue(allUsedSchemas.contains("PingDataOutput21"), "contains 'PingDataOutput21'"); + Assert.assertTrue(allUsedSchemas.contains("SInput22"), "contains 'SInput22'"); + Assert.assertTrue(allUsedSchemas.contains("SOutput22"), "contains 'SInput22'"); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/unusedSchemas.yaml b/modules/openapi-generator/src/test/resources/3_0/unusedSchemas.yaml index 3df4d6e1321..9e2179a2e11 100644 --- a/modules/openapi-generator/src/test/resources/3_0/unusedSchemas.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/unusedSchemas.yaml @@ -263,6 +263,23 @@ paths: application/json: schema: $ref: '#/components/schemas/PingDataOutput21' + /some/p22: + post: + operationId: op22 + parameters: + - name: callbackUrl + in: query + required: true + schema: + type: string + format: uri + example: https://some-server.com + responses: + '201': + description: OK + callbacks: + sharedCallback: + $ref: "#/components/callbacks/sharedCallback22" components: schemas: UnusedObj1: @@ -507,6 +524,20 @@ components: type: integer reply: type: String + SInput22: + type: object + properties: + uuid: + type: String + request: + type: String + SOutput22: + type: object + properties: + uuid: + type: String + response: + type: String SomeObjShared: type: object properties: @@ -560,4 +591,20 @@ components: in: query schema: $ref: '#/components/schemas/SomeObj11' + callbacks: + sharedCallback22: + '{$request.query.callbackUrl}/shared': + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SInput22' + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/SOutput22' \ No newline at end of file -- GitLab From cf246f0ed08a39d2251e888ba3c696021082fd20 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson <dev@jmini.fr> Date: Tue, 11 Dec 2018 08:56:33 +0100 Subject: [PATCH 5/6] Fixing Petstore v2 --- modules/openapi-generator/src/test/resources/2_0/petstore.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore.json b/modules/openapi-generator/src/test/resources/2_0/petstore.json index 9279019b407..0fe9e07ab0c 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore.json +++ b/modules/openapi-generator/src/test/resources/2_0/petstore.json @@ -127,7 +127,7 @@ "enum": ["available", "pending", "sold"] }, "collectionFormat": "multi", - "default": "available" + "default": ["available"] } ], "responses": { -- GitLab From 1e037030a1d3692355d2de55382b036008edaa47 Mon Sep 17 00:00:00 2001 From: Jeremie Bresson <dev@jmini.fr> Date: Tue, 11 Dec 2018 16:26:30 +0100 Subject: [PATCH 6/6] Update samples --- .../petstore/go/go-petstore/api/openapi.yaml | 626 ++++++++--------- .../petstore/haskell-http-client/openapi.yaml | 626 ++++++++--------- .../src/main/openapi/openapi.yaml | 630 +++++++++--------- .../jaxrs-spec/src/main/openapi/openapi.yaml | 630 +++++++++--------- .../api/openapi.yaml | 620 ++++++++--------- .../output/rust-server-test/api/openapi.yaml | 22 +- .../src/main/resources/openapi.yaml | 630 +++++++++--------- 7 files changed, 1892 insertions(+), 1892 deletions(-) diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 40878d2c58d..3e3f1edbc44 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1078,6 +1078,40 @@ paths: - pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: default-name @@ -1128,45 +1162,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1181,6 +1242,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1201,23 +1279,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1229,11 +1290,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1243,6 +1303,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1274,40 +1422,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1321,23 +1435,31 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1346,21 +1468,56 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1381,77 +1538,26 @@ components: type: array type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1468,17 +1574,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1494,70 +1620,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1567,68 +1629,6 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1638,9 +1638,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1649,3 +1646,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 40878d2c58d..3e3f1edbc44 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1078,6 +1078,40 @@ paths: - pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: default-name @@ -1128,45 +1162,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1181,6 +1242,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1201,23 +1279,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1229,11 +1290,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1243,6 +1303,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1274,40 +1422,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1321,23 +1435,31 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1346,21 +1468,56 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1381,77 +1538,26 @@ components: type: array type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1468,17 +1574,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1494,70 +1620,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1567,68 +1629,6 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1638,9 +1638,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1649,3 +1646,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 7aaa0e0a18b..f05bb168cf7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1148,6 +1148,40 @@ paths: - tag: pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: default-name @@ -1198,45 +1232,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1251,6 +1312,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1271,25 +1349,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1301,11 +1360,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1315,6 +1373,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1346,40 +1492,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1393,23 +1505,33 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: + example: + 123-list: 123-list properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1418,21 +1540,56 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1453,77 +1610,26 @@ components: type: array type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1540,17 +1646,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1566,70 +1692,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1639,68 +1701,6 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1710,9 +1710,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1721,3 +1718,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 7aaa0e0a18b..f05bb168cf7 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1148,6 +1148,40 @@ paths: - tag: pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: default-name @@ -1198,45 +1232,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1251,6 +1312,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1271,25 +1349,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1301,11 +1360,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1315,6 +1373,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1346,40 +1492,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1393,23 +1505,33 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: + example: + 123-list: 123-list properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1418,21 +1540,56 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1453,77 +1610,26 @@ components: type: array type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1540,17 +1646,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1566,70 +1692,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1639,68 +1701,6 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1710,9 +1710,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1721,3 +1718,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 4d996d5916a..c57a0ffec1e 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -966,6 +966,40 @@ paths: - $another-fake? components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: name @@ -1013,45 +1047,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1066,6 +1127,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1086,23 +1164,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1114,11 +1175,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1128,6 +1188,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1159,40 +1307,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1206,23 +1320,31 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1231,21 +1353,57 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_of_enum: + additionalProperties: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1273,77 +1431,26 @@ components: type: string type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1369,140 +1476,33 @@ components: type: array type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_of_enum: - additionalProperties: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1512,9 +1512,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1523,4 +1520,7 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml index 608408baae2..10a6a87b9dd 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml @@ -96,6 +96,17 @@ components: description: An additionalPropertiesObject example: foo type: object + aNullableContainer: + properties: + NullableThing: + nullable: true + type: string + RequiredNullableThing: + nullable: true + type: string + required: + - RequiredNullableThing + type: object ObjectOfObjects: description: An object of objects properties: @@ -119,15 +130,4 @@ components: type: string required: - required_thing - aNullableContainer: - properties: - NullableThing: - nullable: true - type: string - RequiredNullableThing: - nullable: true - type: string - required: - - RequiredNullableThing - type: object diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index f3f7ba18010..0e2c756cb40 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1206,6 +1206,40 @@ paths: - tag: pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: name: default-name @@ -1256,45 +1290,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1309,6 +1370,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1329,25 +1407,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1359,11 +1418,10 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: @@ -1373,6 +1431,94 @@ components: breed: type: string type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1404,40 +1550,6 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: map_property: @@ -1451,23 +1563,33 @@ components: type: object type: object type: object - $special[model.name]: + MixedPropertiesAndAdditionalPropertiesClass: properties: - $special[property.name]: - format: int64 - type: integer + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + List: + example: + 123-list: 123-list properties: - return: - format: int32 - type: integer + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string type: object - xml: - name: Return ReadOnlyFirst: properties: bar: @@ -1476,21 +1598,56 @@ components: baz: type: string type: object - ArrayOfArrayOfNumberOnly: + hasOnlyReadOnly: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string ArrayTest: properties: array_of_string: @@ -1511,77 +1668,26 @@ components: type: array type: array type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + NumberOnly: properties: - my_number: + JustNumber: type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ArrayOfNumberOnly: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - required: - - byte - - date - - number - - password + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1598,17 +1704,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1624,70 +1750,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1697,68 +1759,6 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object securitySchemes: petstore_auth: flows: @@ -1768,9 +1768,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1779,3 +1776,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http -- GitLab