From ad3b5f70450cc80bff5e2d9338ad2abca8855b5b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 10 May 2022 17:13:57 +0800 Subject: [PATCH 1/4] [Inline model resolver] various improvements (#12293) * better handling of requestbody in the inline resolver * remove commented code * better request body naming * fix unique naming * minor code format change * removed additional underscore from names, fix test * more fixes, update tests * fix all tests * undo changes to default codegen * update samples * update python tests * add new files * update samples --- .../codegen/InlineModelResolver.java | 195 +++++------ .../codegen/utils/ModelUtils.java | 2 +- .../codegen/DefaultCodegenTest.java | 31 +- .../codegen/InlineModelResolverTest.java | 54 ++-- .../java/spring/SpringCodegenTest.java | 8 +- .../TypeScriptClientCodegenTest.java | 6 +- .../codegen/utils/ModelUtilsTest.java | 3 +- .../test/resources/3_0/composed-oneof.yaml | 11 +- .../resources/3_0/inline_model_resolver.yaml | 2 +- .../.openapi-generator/FILES | 16 +- .../csharp-netcore-complex-files/README.md | 8 +- .../docs/MultipartApi.md | 6 +- .../docs/MultipartArrayRequest.md | 10 + .../docs/MultipartMixedRequest.md | 12 + .../docs/MultipartMixedRequestMarker.md | 11 + .../docs/MultipartSingleRequest.md | 10 + .../Model/MultipartArrayRequestTests.cs | 70 ++++ .../Model/MultipartMixedRequestMarkerTests.cs | 70 ++++ .../Model/MultipartMixedRequestTests.cs | 86 +++++ .../Model/MultipartSingleRequestTests.cs | 70 ++++ .../src/Org.OpenAPITools/Api/MultipartApi.cs | 16 +- .../Model/MultipartArrayRequest.cs | 121 +++++++ .../Model/MultipartMixedRequest.cs | 154 +++++++++ .../Model/MultipartMixedRequestMarker.cs | 120 +++++++ .../Model/MultipartSingleRequest.cs | 121 +++++++ .../petstore/go/go-petstore/api/openapi.yaml | 260 ++++++++------- .../petstore/haskell-http-client/openapi.yaml | 260 ++++++++------- .../java/apache-httpclient/api/openapi.yaml | 260 ++++++++------- .../java/feign-no-nullable/api/openapi.yaml | 260 ++++++++------- .../petstore/java/feign/api/openapi.yaml | 183 +---------- .../java/google-api-client/api/openapi.yaml | 260 ++++++++------- .../petstore/java/jersey1/api/openapi.yaml | 260 ++++++++------- .../api/openapi.yaml | 260 ++++++++------- .../java/jersey2-java8/api/openapi.yaml | 260 ++++++++------- .../petstore/java/jersey3/api/openapi.yaml | 185 +---------- .../java/native-async/api/openapi.yaml | 260 ++++++++------- .../petstore/java/native/api/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi/openapi.yaml | 260 ++++++++------- .../api/openapi.yaml | 260 ++++++++------- .../java/okhttp-gson/.openapi-generator/FILES | 4 +- .../petstore/java/okhttp-gson/README.md | 2 +- .../java/okhttp-gson/api/openapi.yaml | 189 +---------- ...ineAllOfArrayAllofDogPropertyInnerAllOf.md | 13 + .../java/org/openapitools/client/JSON.java | 2 +- .../client/model/ArrayOfInlineAllOf.java | 2 +- ...eAllOfArrayAllofDogPropertyInnerAllOf.java | 273 ++++++++++++++++ ...OfArrayAllofDogPropertyInnerAllOfTest.java | 50 +++ .../rest-assured-jackson/api/openapi.yaml | 260 ++++++++------- .../java/rest-assured/api/openapi.yaml | 260 ++++++++------- .../petstore/java/resteasy/api/openapi.yaml | 260 ++++++++------- .../resttemplate-withXml/api/openapi.yaml | 260 ++++++++------- .../java/resttemplate/api/openapi.yaml | 260 ++++++++------- .../java/retrofit2-play26/api/openapi.yaml | 260 ++++++++------- .../petstore/java/retrofit2/api/openapi.yaml | 260 ++++++++------- .../java/retrofit2rx2/api/openapi.yaml | 260 ++++++++------- .../java/retrofit2rx3/api/openapi.yaml | 260 ++++++++------- .../java/vertx-no-nullable/api/openapi.yaml | 260 ++++++++------- .../petstore/java/vertx/api/openapi.yaml | 260 ++++++++------- .../petstore/java/webclient/api/openapi.yaml | 183 +---------- .../php-dt-modern/.openapi-generator/FILES | 4 +- .../php-dt-modern/src/App/ApiClient.php | 24 +- .../src/App/DTO/UpdatePetWithFormRequest.php | 24 ++ .../src/App/DTO/UploadFileRequest.php | 25 ++ .../petstore/php-dt/.openapi-generator/FILES | 4 +- .../petstore/php-dt/src/App/ApiClient.php | 24 +- .../src/App/DTO/UpdatePetWithFormRequest.php | 28 ++ .../php-dt/src/App/DTO/UploadFileRequest.php | 29 ++ .../builds/composed-schemas/api.ts | 123 ++++--- .../builds/enum/.openapi-generator/FILES | 2 +- .../builds/enum/apis/DefaultApi.ts | 18 +- .../FakeEnumRequestPostInlineRequest.ts | 122 +++++++ .../builds/enum/models/index.ts | 2 +- .../.openapi-generator/FILES | 2 +- .../with-string-enums/apis/DefaultApi.ts | 18 +- .../FakeEnumRequestPostInlineRequest.ts | 118 +++++++ .../builds/with-string-enums/models/index.ts | 2 +- .../petstore/go/go-petstore/api/openapi.yaml | 183 +---------- .../java/jersey2-java8/api/openapi.yaml | 185 +---------- .../petstore/python/.openapi-generator/FILES | 8 +- .../openapi3/client/petstore/python/README.md | 4 +- .../client/petstore/python/docs/FakeApi.md | 18 +- .../InlineAdditionalPropertiesRefPayload.md | 2 +- ...nlineAdditionalPropertiesPayloadRequest.md | 13 + ...lPropertiesPayloadRequestArrayDataInner.md | 12 + .../python/petstore_api/api/fake_api.py | 16 +- ...nline_additional_properties_ref_payload.py | 10 +- ...e_additional_properties_payload_request.py | 269 ++++++++++++++++ ...erties_payload_request_array_data_inner.py | 263 +++++++++++++++ .../python/petstore_api/models/__init__.py | 4 +- .../petstore/python/test/test_fake_api.py | 24 +- ...e_additional_properties_payload_request.py | 37 +++ ...erties_payload_request_array_data_inner.py | 35 ++ .../python/tests_manual/test_fake_api.py | 20 +- .../composed-schemas/.openapi-generator/FILES | 4 +- .../builds/composed-schemas/DefaultApi.md | 18 +- .../composed-schemas/apis/DefaultApi.ts | 26 +- .../composed-schemas/models/InlineRequest.ts | 62 ++++ .../composed-schemas/models/InlineRequest1.ts | 61 ++++ .../composed-schemas/models/InlineRequest2.ts | 35 ++ .../models/ObjectSerializer.ts | 14 +- .../builds/composed-schemas/models/all.ts | 4 +- .../composed-schemas/types/ObjectParamAPI.ts | 22 +- .../composed-schemas/types/ObservableAPI.ts | 22 +- .../composed-schemas/types/PromiseAPI.ts | 22 +- .../src/main/resources/openapi.yaml | 35 +- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 35 +- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 35 +- .../wwwroot/openapi-original.json | 48 +-- .../wwwroot/openapi-original.json | 48 +-- .../wwwroot/openapi-original.json | 49 +-- .../wwwroot/openapi-original.json | 49 +-- .../wwwroot/openapi-original.json | 48 +-- .../petstore/erlang-server/priv/openapi.json | 49 +-- .../petstore/go-api-server/api/openapi.yaml | 35 +- .../petstore/go-chi-server/api/openapi.yaml | 35 +- .../go-echo-server/.docs/api/openapi.yaml | 35 +- .../go-gin-api-server/api/openapi.yaml | 35 +- .../go-server-required/api/openapi.yaml | 35 +- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../public/openapi.json | 304 ++++++++++-------- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../public/openapi.json | 48 +-- .../java-play-framework/public/openapi.json | 48 +-- .../src/main/resources/config/openapi.json | 48 +-- .../src/main/resources/openapi.yaml | 35 +- .../src/main/openapi/openapi.yaml | 260 ++++++++------- .../jaxrs-spec/src/main/openapi/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 35 +- .../src/main/resources/openapi.yaml | 34 +- .../src/main/resources/openapi.yaml | 34 +- .../src/main/resources/openapi.yaml | 34 +- .../src/main/resources/openapi.yaml | 34 +- .../src/main/resources/openapi.yaml | 34 +- .../src/openapi_server/openapi/openapi.yaml | 34 +- .../openapi_server/openapi/openapi.yaml | 34 +- .../petstore/python-fastapi/openapi.yaml | 35 +- .../openapi_server/openapi/openapi.yaml | 34 +- .../multipart-v3/.openapi-generator/FILES | 2 +- .../rust-server/output/multipart-v3/README.md | 2 +- .../output/multipart-v3/api/openapi.yaml | 19 +- .../output/multipart-v3/docs/InlineRequest.md | 11 + .../output/multipart-v3/src/models.rs | 40 +-- .../no-example-v3/.openapi-generator/FILES | 2 +- .../output/no-example-v3/README.md | 2 +- .../output/no-example-v3/api/openapi.yaml | 17 +- .../no-example-v3/docs/InlineRequest.md | 10 + .../output/no-example-v3/docs/default_api.md | 4 +- .../no-example-v3/examples/server/server.rs | 4 +- .../output/no-example-v3/src/client/mod.rs | 4 +- .../output/no-example-v3/src/lib.rs | 8 +- .../output/no-example-v3/src/models.rs | 36 +-- .../output/no-example-v3/src/server/mod.rs | 22 +- .../api/openapi.yaml | 220 +++++++------ .../rust-server-test/.openapi-generator/FILES | 2 +- .../output/rust-server-test/README.md | 2 +- .../output/rust-server-test/api/openapi.yaml | 18 +- .../rust-server-test/docs/DummyPutRequest.md | 11 + .../rust-server-test/docs/default_api.md | 2 +- .../examples/server/server.rs | 2 +- .../output/rust-server-test/src/client/mod.rs | 2 +- .../output/rust-server-test/src/lib.rs | 6 +- .../output/rust-server-test/src/models.rs | 134 ++++---- .../output/rust-server-test/src/server/mod.rs | 2 +- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- .../src/main/resources/openapi.yaml | 260 ++++++++------- 186 files changed, 9705 insertions(+), 8052 deletions(-) create mode 100644 samples/client/others/csharp-netcore-complex-files/docs/MultipartArrayRequest.md create mode 100644 samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequest.md create mode 100644 samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequestMarker.md create mode 100644 samples/client/others/csharp-netcore-complex-files/docs/MultipartSingleRequest.md create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartArrayRequestTests.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestMarkerTests.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestTests.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartSingleRequestTests.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs create mode 100644 samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs create mode 100644 samples/client/petstore/java/okhttp-gson/docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOfTest.java create mode 100644 samples/client/petstore/php-dt-modern/src/App/DTO/UpdatePetWithFormRequest.php create mode 100644 samples/client/petstore/php-dt-modern/src/App/DTO/UploadFileRequest.php create mode 100644 samples/client/petstore/php-dt/src/App/DTO/UpdatePetWithFormRequest.php create mode 100644 samples/client/petstore/php-dt/src/App/DTO/UploadFileRequest.php create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestPostInlineRequest.ts create mode 100644 samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md create mode 100644 samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md create mode 100644 samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py create mode 100644 samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py create mode 100644 samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py create mode 100644 samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py create mode 100644 samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest.ts create mode 100644 samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest1.ts create mode 100644 samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest2.ts create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/docs/InlineRequest.md create mode 100644 samples/server/petstore/rust-server/output/no-example-v3/docs/InlineRequest.md create mode 100644 samples/server/petstore/rust-server/output/rust-server-test/docs/DummyPutRequest.md diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index d74ffdd59b2f..fd41aa5a0cca 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -160,7 +160,8 @@ private boolean isModelNeeded(Schema schema) { * Recursively gather inline models that need to be generated and * replace inline schemas with $ref to schema to-be-generated. * - * @param schema target schema + * @param schema target schema + * @param modelPrefix model name (usually the prefix of the inline model name) */ private void gatherInlineModels(Schema schema, String modelPrefix) { if (schema.get$ref() != null) { @@ -183,13 +184,12 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { if (props != null) { for (String propName : props.keySet()) { Schema prop = props.get(propName); + String schemaName = resolveModelName(prop.getTitle(), modelPrefix + "_" + propName); // Recurse to create $refs for inner models - //gatherInlineModels(prop, modelPrefix + StringUtils.camelize(propName)); - gatherInlineModels(prop, modelPrefix + "_" + propName); + gatherInlineModels(prop, schemaName); if (isModelNeeded(prop)) { // If this schema should be split into its own model, do so - //Schema refSchema = this.makeSchemaResolve(modelPrefix, StringUtils.camelize(propName), prop); - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_" + propName, prop); + Schema refSchema = this.makeSchemaInComponents(schemaName, prop); props.put(propName, refSchema); } else if (prop instanceof ComposedSchema) { ComposedSchema m = (ComposedSchema) prop; @@ -206,11 +206,12 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { if (schema.getAdditionalProperties() != null) { if (schema.getAdditionalProperties() instanceof Schema) { Schema inner = (Schema) schema.getAdditionalProperties(); + String schemaName = resolveModelName(schema.getTitle(), modelPrefix + "_" + "_value"); // Recurse to create $refs for inner models - gatherInlineModels(inner, modelPrefix + "_addl_props"); + gatherInlineModels(inner, schemaName); if (isModelNeeded(inner)) { // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_addl_props", inner); + Schema refSchema = this.makeSchemaInComponents(schemaName, inner); schema.setAdditionalProperties(refSchema); } } @@ -231,17 +232,23 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { if (schema instanceof ArraySchema) { ArraySchema array = (ArraySchema) schema; Schema items = array.getItems(); + /*if (items.getTitle() != null) { + LOGGER.info("schema title {}", items); + throw new RuntimeException("getTitle for array item is not null"); + }*/ if (items == null) { LOGGER.error("Illegal schema found with array type but no items," + " items must be defined for array schemas:\n " + schema.toString()); return; } + String schemaName = resolveModelName(items.getTitle(), modelPrefix + "_inner"); + // Recurse to create $refs for inner models - gatherInlineModels(items, modelPrefix + "Items"); + gatherInlineModels(items, schemaName); if (isModelNeeded(items)) { // If this schema should be split into its own model, do so - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_inner", items); + Schema refSchema = this.makeSchemaInComponents(schemaName, items); array.setItems(refSchema); } } @@ -252,10 +259,11 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { List newAllOf = new ArrayList(); boolean atLeastOneModel = false; for (Schema inner : m.getAllOf()) { + String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_allOf"); // Recurse to create $refs for inner models - gatherInlineModels(inner, modelPrefix + "_allOf"); + gatherInlineModels(inner, schemaName); if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_allOf", inner); + Schema refSchema = this.makeSchemaInComponents(schemaName, inner); newAllOf.add(refSchema); // replace with ref atLeastOneModel = true; } else { @@ -278,10 +286,11 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { if (m.getAnyOf() != null) { List newAnyOf = new ArrayList(); for (Schema inner : m.getAnyOf()) { + String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_anyOf"); // Recurse to create $refs for inner models - gatherInlineModels(inner, modelPrefix + "_anyOf"); + gatherInlineModels(inner, schemaName); if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_anyOf", inner); + Schema refSchema = this.makeSchemaInComponents(schemaName, inner); newAnyOf.add(refSchema); // replace with ref } else { newAnyOf.add(inner); @@ -292,10 +301,11 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { if (m.getOneOf() != null) { List newOneOf = new ArrayList(); for (Schema inner : m.getOneOf()) { + String schemaName = resolveModelName(inner.getTitle(), modelPrefix + "_oneOf"); // Recurse to create $refs for inner models - gatherInlineModels(inner, modelPrefix + "_oneOf"); + gatherInlineModels(inner, schemaName); if (isModelNeeded(inner)) { - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_oneOf", inner); + Schema refSchema = this.makeSchemaInComponents(schemaName, inner); newOneOf.add(refSchema); // replace with ref } else { newOneOf.add(inner); @@ -307,15 +317,48 @@ private void gatherInlineModels(Schema schema, String modelPrefix) { // Check not schema if (schema.getNot() != null) { Schema not = schema.getNot(); + String schemaName = resolveModelName(schema.getTitle(), modelPrefix + "_not"); // Recurse to create $refs for inner models - gatherInlineModels(not, modelPrefix + "_not"); + gatherInlineModels(not, schemaName); if (isModelNeeded(not)) { - Schema refSchema = this.makeSchemaResolve(modelPrefix, "_not", not); + Schema refSchema = this.makeSchemaInComponents(schemaName, not); schema.setNot(refSchema); } } } + /** + * Flatten inline models in content + * + * @param content target content + * @param name backup name if no title is found + */ + private void flattenContent(Content content, String name) { + if (content == null || content.isEmpty()) { + return; + } + + for (String contentType : content.keySet()) { + MediaType mediaType = content.get(contentType); + if (mediaType == null) { + continue; + } + Schema schema = mediaType.getSchema(); + if (schema == null) { + continue; + } + String schemaName = resolveModelName(schema.getTitle(), name); // name example: testPost_request + // Recursively gather/make inline models within this schema if any + gatherInlineModels(schema, schemaName); + if (isModelNeeded(schema)) { + // If this schema should be split into its own model, do so + //Schema refSchema = this.makeSchema(schemaName, schema); + Schema refSchema = this.makeSchemaInComponents(schemaName, schema); + mediaType.setSchema(refSchema); + } + } + } + /** * Flatten inline models in RequestBody * @@ -328,78 +371,14 @@ private void flattenRequestBody(String pathname, Operation operation) { return; } - Schema model = ModelUtils.getSchemaFromRequestBody(requestBody); - if (model instanceof ObjectSchema) { - Schema obj = model; - if (obj.getType() == null || "object".equals(obj.getType())) { - if (obj.getProperties() != null && obj.getProperties().size() > 0) { - flattenProperties(openAPI, obj.getProperties(), pathname); - // for model name, use "title" if defined, otherwise default to 'inline_object' - String modelName = resolveModelName(obj.getTitle(), "inline_object"); - modelName = addSchemas(modelName, model); - // create request body - RequestBody rb = new RequestBody(); - rb.setRequired(requestBody.getRequired()); - Content content = new Content(); - MediaType mt = new MediaType(); - Schema schema = new Schema(); - schema.set$ref(modelName); - mt.setSchema(schema); - - // get "consumes", e.g. application/xml, application/json - Set consumes; - if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { - consumes = new HashSet<>(); - consumes.add("application/json"); // default to application/json - LOGGER.info("Default to application/json for inline body schema"); - } else { - consumes = requestBody.getContent().keySet(); - } - - for (String consume : consumes) { - content.addMediaType(consume, mt); - } - - rb.setContent(content); - - // add to openapi "components" - if (openAPI.getComponents().getRequestBodies() == null) { - Map requestBodies = new HashMap(); - requestBodies.put(modelName, rb); - openAPI.getComponents().setRequestBodies(requestBodies); - } else { - openAPI.getComponents().getRequestBodies().put(modelName, rb); - } - - // update requestBody to use $ref instead of inline def - requestBody.set$ref(modelName); - - } - } - } else if (model instanceof ArraySchema) { - ArraySchema am = (ArraySchema) model; - Schema inner = am.getItems(); - if (inner instanceof ObjectSchema) { - ObjectSchema op = (ObjectSchema) inner; - if (op.getProperties() != null && op.getProperties().size() > 0) { - flattenProperties(openAPI, op.getProperties(), pathname); - // Generate a unique model name based on the title. - String modelName = resolveModelName(op.getTitle(), null); - Schema innerModel = modelFromProperty(openAPI, op, modelName); - String existing = matchGenerated(innerModel); - if (existing != null) { - Schema schema = new Schema().$ref(existing); - schema.setRequired(op.getRequired()); - am.setItems(schema); - } else { - modelName = addSchemas(modelName, innerModel); - Schema schema = new Schema().$ref(modelName); - schema.setRequired(op.getRequired()); - am.setItems(schema); - } - } - } + // unalias $ref + if (requestBody.get$ref() != null) { + String ref = ModelUtils.getSimpleRef(requestBody.get$ref()); + requestBody = openAPI.getComponents().getRequestBodies().get(ref); } + + String name = operation.getOperationId() == null ? "inline_request" : operation.getOperationId() + "_request"; + flattenContent(requestBody.getContent(), name); } /** @@ -690,16 +669,16 @@ private boolean schemaContainsExample(Schema m) { *

* e.g. io.schema.User_name => io_schema_User_name * - * @param title String title field in the schema if present - * @param key String model name + * @param title String title field in the schema if present + * @param modelName String model name * @return if provided the sanitized {@code title}, else the sanitized {@code key} */ - private String resolveModelName(String title, String key) { + private String resolveModelName(String title, String modelName) { if (title == null) { - if (key == null) { + if (modelName == null) { return uniqueName("inline_object"); } - return uniqueName(sanitizeName(key)); + return uniqueName(sanitizeName(modelName)); } else { return uniqueName(sanitizeName(title)); } @@ -731,6 +710,8 @@ private void addGenerated(String name, Schema model) { * Sanitizes the input so that it's valid name for a class or interface *

* e.g. 12.schema.User name => _2_schema_User_name + * + * @param name name to be processed to make sure it's sanitized */ private String sanitizeName(final String name) { return name @@ -738,9 +719,13 @@ private String sanitizeName(final String name) { .replaceAll("[^A-Za-z0-9]", "_"); // e.g. io.schema.User name => io_schema_User_name } + /** + * Generate a unique name for the input + * + * @param name name to be processed to make sure it's unique + */ private String uniqueName(final String name) { if (openAPI.getComponents().getSchemas() == null) { // no schema has been created - uniqueNames.add(name); return name; } @@ -748,7 +733,6 @@ private String uniqueName(final String name) { int count = 0; while (true) { if (!openAPI.getComponents().getSchemas().containsKey(uniqueName) && !uniqueNames.contains(uniqueName)) { - uniqueNames.add(uniqueName); return uniqueName; } uniqueName = name + "_" + ++count; @@ -896,24 +880,6 @@ private Schema modelFromProperty(OpenAPI openAPI, Schema object, String path) { return model; } - /** - * Resolve namespace conflicts using: - * title (if title exists) or - * prefix + suffix (if title not specified) - * - * @param prefix used to form name if no title found in schema - * @param suffix used to form name if no title found in schema - * @param schema title property used to form name if exists and schema definition used - * to create new schema if doesn't exist - * @return a new schema or $ref to an existing one if it was already created - */ - private Schema makeSchemaResolve(String prefix, String suffix, Schema schema) { - if (schema.getTitle() == null) { - return makeSchemaInComponents(uniqueName(sanitizeName(prefix + suffix)), schema); - } - return makeSchemaInComponents(uniqueName(sanitizeName(schema.getTitle())), schema); - } - /** * Move schema to components (if new) and return $ref to schema or * existing schema. @@ -935,6 +901,7 @@ private Schema makeSchemaInComponents(String name, Schema schema) { refSchema = new Schema().$ref(name); } this.copyVendorExtensions(schema, refSchema); + return refSchema; } @@ -986,6 +953,8 @@ private String addSchemas(String name, Schema schema) { LOGGER.info("Inline schema created as {}. To have complete control of the model name, set the `title` field or use the inlineSchemaNameMapping option (--inline-schema-name-mapping in CLI).", name); } + uniqueNames.add(name); + return name; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index ac3ef1346b01..e575a5739c23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -1017,7 +1017,7 @@ public static Callback getCallback(OpenAPI openAPI, String name) { * Return the first defined Schema for a RequestBody * * @param requestBody request body of the operation - * @return firstSchema + * @return first schema */ public static Schema getSchemaFromRequestBody(RequestBody requestBody) { return getSchemaFromContent(requestBody.getContent()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 982873161d02..412b7b95a32e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -231,7 +231,8 @@ public void testFormParameterHasDefaultValue() { final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); - Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody()); + Schema requestBodySchema = ModelUtils.getReferencedSchema(openAPI, + ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody())); CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); Assert.assertEquals(codegenParameter.defaultValue, "-efg"); @@ -245,6 +246,8 @@ public void testDateTimeFormParameterHasDefaultValue() { codegen.setOpenAPI(openAPI); Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); + // dereference + requestBodySchema = ModelUtils.getReferencedSchema(openAPI, requestBodySchema); CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", (Schema) requestBodySchema.getProperties().get("visitDate"), new HashSet<>()); @@ -613,7 +616,8 @@ public void testGetSchemaTypeWithComposedSchemaWithOneOf() { final DefaultCodegen codegen = new DefaultCodegen(); Operation operation = openAPI.getPaths().get("/state").getPost(); - Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); + Schema schema = ModelUtils.getReferencedSchema(openAPI, + ModelUtils.getSchemaFromRequestBody(operation.getRequestBody())); String type = codegen.getSchemaType(schema); Assert.assertNotNull(type); @@ -2344,18 +2348,14 @@ public void testUseOneOfInterfaces() { cg.preprocessOpenAPI(openAPI); // assert names of the response/request schema oneOf interfaces are as expected - Assert.assertEquals( - openAPI.getPaths() - .get("/state") - .getPost() - .getRequestBody() - .getContent() - .get("application/json") - .getSchema() - .getExtensions() - .get("x-one-of-name"), - "CreateState" - ); + Schema s = ModelUtils.getReferencedSchema(openAPI, openAPI.getPaths() + .get("/state") + .getPost() + .getRequestBody() + .getContent() + .get("application/json") + .getSchema()); + Assert.assertEquals(s.getExtensions().get("x-one-of-name"), "CreateStateRequest"); Assert.assertEquals( openAPI.getPaths() .get("/state") @@ -2372,7 +2372,8 @@ public void testUseOneOfInterfaces() { // for the array schema, assert that a oneOf interface was added to schema map Schema items = ((ArraySchema) openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema")).getItems(); Assert.assertEquals(items.get$ref(), "#/components/schemas/CustomOneOfArraySchema_inner"); - Schema innerItem = openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema_inner"); + //Assert.assertEquals(items.get$ref(), "#/components/schemas/createState_request"); + Schema innerItem = ModelUtils.getReferencedSchema(openAPI, openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema_inner")); Assert.assertEquals(innerItem.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaInner"); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index f98fc0972337..66b6b28d9d5b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -175,7 +175,7 @@ public void resolveInlineModel2EqualInnerModels() { } @Test - public void resolveInlineModel2DifferentInnerModelsWIthSameTitle() { + public void resolveInlineModel2DifferentInnerModelsWithSameTitle() { OpenAPI openapi = new OpenAPI(); openapi.setComponents(new Components()); openapi.getComponents().addSchemas("User", new ObjectSchema() @@ -329,7 +329,9 @@ public void resolveInlineRequestBodyWhenNoComponents() { new InlineModelResolver().flatten(openAPI); assertNotNull(openAPI.getComponents()); - assertNotNull(openAPI.getComponents().getRequestBodies()); + // no longer create inline requestBodies as references in the refactored inline model resolver (6.x) + assertNull(openAPI.getComponents().getRequestBodies()); + assertNotNull(openAPI.getComponents().getSchemas().get("test1_request")); } @Test @@ -359,7 +361,8 @@ public void resolveInlineRequestBody() { .get("/resolve_inline_request_body") .getPost() .getRequestBody(); - assertNotNull(requestBodyReference.get$ref()); + assertEquals("#/components/schemas/resolveInlineRequestBody_request", + requestBodyReference.getContent().get("application/json").getSchema().get$ref()); RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference); MediaType mediaType = requestBody.getContent().get("application/json"); @@ -391,7 +394,8 @@ public void resolveInlineRequestBodyWithTitle() { new InlineModelResolver().flatten(openAPI); RequestBody requestBodyReference = openAPI.getPaths().get("/resolve_inline_request_body_with_title").getPost().getRequestBody(); - assertEquals("#/components/requestBodies/resolve_inline_request_body_with_title", requestBodyReference.get$ref()); + assertEquals("#/components/schemas/resolve_inline_request_body_with_title", + requestBodyReference.getContent().get("application/json").getSchema().get$ref()); } @Test @@ -429,7 +433,7 @@ public void resolveInlineArrayRequestBody() { ArraySchema requestBody = (ArraySchema) mediaType.getSchema(); assertNotNull(requestBody.getItems().get$ref()); - assertEquals("#/components/schemas/inline_object_2", requestBody.getItems().get$ref()); + assertEquals("#/components/schemas/resolveInlineArrayRequestBody_request_inner", requestBody.getItems().get$ref()); Schema items = ModelUtils.getReferencedSchema(openAPI, ((ArraySchema) mediaType.getSchema()).getItems()); assertTrue(items.getProperties().get("street") instanceof StringSchema); @@ -603,10 +607,11 @@ public void arbitraryObjectRequestBodyProperty() { .getContent() .get("application/json"); - assertTrue(mediaType.getSchema() instanceof ObjectSchema); - - ObjectSchema requestBodySchema = (ObjectSchema) mediaType.getSchema(); - assertTrue(requestBodySchema.getProperties().get("arbitrary_object_request_body_property") instanceof ObjectSchema); + assertEquals("#/components/schemas/arbitraryObjectRequestBodyProperty_request", mediaType.getSchema().get$ref()); + Schema requestBodySchema = ModelUtils.getReferencedSchema(openAPI, mediaType.getSchema()); + assertNotNull(requestBodySchema); + assertEquals(1, requestBodySchema.getProperties().size(), 1); + assertTrue(requestBodySchema.getProperties().get("arbitrary_object_request_body_property") instanceof ObjectSchema); } @Test @@ -903,9 +908,9 @@ public void arbitraryObjectModelWithArrayInlineWithTitle() { ObjectSchema items = (ObjectSchema) openAPI.getComponents().getSchemas().get("ArbitraryObjectModelWithArrayInlineWithTitleInner"); assertEquals("ArbitraryObjectModelWithArrayInlineWithTitleInner", items.getTitle()); - assertTrue(items.getProperties().get("arbitrary_object_model_with_array_inline_with_title") instanceof ObjectSchema); + assertTrue(items.getProperties().get("arbitrary_object_model_with_array_inline_with_title_property") instanceof ObjectSchema); - ObjectSchema itemsProperty = (ObjectSchema) items.getProperties().get("arbitrary_object_model_with_array_inline_with_title"); + ObjectSchema itemsProperty = (ObjectSchema) items.getProperties().get("arbitrary_object_model_with_array_inline_with_title_property"); assertNull(itemsProperty.getProperties()); } @@ -941,7 +946,6 @@ public void nullable() { Schema nullablePropertySchema = ModelUtils.getReferencedSchema(openAPI, nullablePropertyReference); assertTrue(nullablePropertySchema.getNullable()); - Schema nullableRequestBodyReference = (Schema) openAPI .getPaths() .get("/nullable_properties") @@ -949,11 +953,14 @@ public void nullable() { .getRequestBody() .getContent() .get("application/json") - .getSchema() - .getProperties() - .get("nullable_request_body_property"); + .getSchema(); + //.getProperties() + //.get("nullable_request_body_property"); Schema nullableRequestBodySchema = ModelUtils.getReferencedSchema(openAPI, nullableRequestBodyReference); - assertTrue(nullableRequestBodySchema.getNullable()); + //assertEquals(nullableRequestBodySchema, ""); + Schema nullableSchema = ModelUtils.getReferencedSchema(openAPI, + ((Schema)nullableRequestBodySchema.getProperties().get("nullable_request_body_property"))); + assertTrue(nullableSchema.getNullable()); } @Test @@ -970,14 +977,15 @@ public void callbacks() { .get("{$request.body#/callbackUri}") .getPost() .getRequestBody(); - assertNotNull(callbackRequestBodyReference.get$ref()); + assertNotNull(callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()); + assertEquals("#/components/schemas/webhookNotify_request", callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()); - RequestBody resolvedCallbackRequestBody = openAPI + /*RequestBody resolvedCallbackRequestBody = openAPI .getComponents() - .getRequestBodies() - .get(ModelUtils.getSimpleRef(callbackRequestBodyReference.get$ref())); + .getSchemas() + .get(ModelUtils.getSimpleRef(callbackRequestBodyReference.getContent().get("application/json").getSchema().get$ref()));*/ - Schema callbackRequestSchemaReference = resolvedCallbackRequestBody + Schema callbackRequestSchemaReference = callbackRequestBodyReference .getContent() .get("application/json") .getSchema(); @@ -999,8 +1007,8 @@ public void testInlineSchemaNameMapping() { OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); InlineModelResolver resolver = new InlineModelResolver(); Map inlineSchemaNames = new HashMap<>(); - inlineSchemaNames.put("inline_object_2", "SomethingMapped"); - inlineSchemaNames.put("inline_object_4", "nothing_new"); + inlineSchemaNames.put("resolveInlineArrayRequestBody_request_inner", "SomethingMapped"); + inlineSchemaNames.put("arbitraryRequestBodyArrayProperty_request_inner", "nothing_new"); resolver.setInlineSchemaNameMapping(inlineSchemaNames); resolver.flatten(openAPI); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index de2b775456bd..34ae163b2c2e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -517,8 +517,8 @@ public void testDoGenerateRequestBodyRequiredAttribute_3134_Regression() throws generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java")) - .assertMethod("exampleApiPost", "InlineObject") - .hasParameter("inlineObject") + .assertMethod("exampleApiPost", "InlineRequest") + .hasParameter("inlineRequest") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestBody", ImmutableMap.of("required", "false")); @@ -591,7 +591,7 @@ public void testMultipartBoot() throws IOException { // Check that api validates mixed multipart request JavaFileAssert.assertThat(files.get("MultipartMixedApi.java")) - .assertMethod("multipartMixed", "MultipartMixedStatus", "MultipartFile", "MultipartMixedMarker") + .assertMethod("multipartMixed", "MultipartMixedStatus", "MultipartFile", "MultipartMixedRequestMarker") .hasParameter("status").withType("MultipartMixedStatus") .assertParameterAnnotations() .containsWithName("Valid") @@ -602,7 +602,7 @@ public void testMultipartBoot() throws IOException { .assertParameterAnnotations() .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) .toParameter().toMethod() - .hasParameter("marker").withType("MultipartMixedMarker") + .hasParameter("marker").withType("MultipartMixedRequestMarker") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"marker\"", "required", "false")); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java index 3f632714d7ee..8f87c99cb604 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java @@ -53,7 +53,11 @@ public void testComposedSchemasImportTypesIndividually() { codegen.setOpenAPI(openApi); PathItem path = openApi.getPaths().get("/pets"); CodegenOperation operation = codegen.fromOperation("/pets", "patch", path.getPatch(), path.getServers()); - Assert.assertEquals(operation.imports, Sets.newHashSet("Cat", "Dog")); + // TODO revise the commented test below as oneOf is no longer defined inline + //but instead defined using $ref with the new inline model resolver in 6.x + //Assert.assertEquals(operation.imports, Sets.newHashSet("Cat", "Dog")); + Assert.assertEquals(operation.imports, Sets.newHashSet("InlineRequest")); + } @Test 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 51fdf297decb..6251a400aeb8 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 @@ -60,6 +60,7 @@ public void testGetAllUsedSchemas() { "SomeObj18", "Common18", "SomeObj18_allOf", + "inline_request", "Obj19ByAge", "Obj19ByType", "SomeObj20", @@ -78,7 +79,7 @@ public void testGetAllUsedSchemas() { "AChild30", "BChild30" ); - Assert.assertEquals(allUsedSchemas.size(), expectedAllUsedSchemas.size()); + Assert.assertEquals(allUsedSchemas, expectedAllUsedSchemas); Assert.assertTrue(allUsedSchemas.containsAll(expectedAllUsedSchemas)); } diff --git a/modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml b/modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml index da6bd9788b49..a97ed080fcfd 100644 --- a/modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/composed-oneof.yaml @@ -57,11 +57,13 @@ components: oneOf: - $ref: '#/components/schemas/ObjA' - $ref: '#/components/schemas/ObjB' + - $ref: '#/components/schemas/ObjC' discriminator: propertyName: realtype mapping: a-type: '#/components/schemas/ObjA' b-type: '#/components/schemas/ObjB' + c-type: '#/components/schemas/ObjC' ObjA: type: object properties: @@ -78,4 +80,11 @@ components: type: string code: type: integer - format: int32 \ No newline at end of file + format: int32 + ObjC: + type: object + properties: + realtype: + type: string + state: + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml b/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml index 4d10bef6205c..b3f7abfccd58 100644 --- a/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml @@ -382,7 +382,7 @@ components: title: ArbitraryObjectModelWithArrayInlineWithTitleInner type: object properties: - arbitrary_object_model_with_array_inline_with_title: + arbitrary_object_model_with_array_inline_with_title_property: type: object EmptyExampleOnStringTypeModels: type: string diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES index de050ce28dc0..4afed17cb82c 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES @@ -2,12 +2,12 @@ Org.OpenAPITools.sln README.md appveyor.yml -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md docs/MultipartApi.md -docs/MultipartMixedMarker.md +docs/MultipartArrayRequest.md +docs/MultipartMixedRequest.md +docs/MultipartMixedRequestMarker.md docs/MultipartMixedStatus.md +docs/MultipartSingleRequest.md git_push.sh src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj src/Org.OpenAPITools/Api/MultipartApi.cs @@ -28,9 +28,9 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.cs src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs -src/Org.OpenAPITools/Model/InlineObject.cs -src/Org.OpenAPITools/Model/InlineObject1.cs -src/Org.OpenAPITools/Model/InlineObject2.cs -src/Org.OpenAPITools/Model/MultipartMixedMarker.cs +src/Org.OpenAPITools/Model/MultipartArrayRequest.cs +src/Org.OpenAPITools/Model/MultipartMixedRequest.cs +src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs src/Org.OpenAPITools/Model/MultipartMixedStatus.cs +src/Org.OpenAPITools/Model/MultipartSingleRequest.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/others/csharp-netcore-complex-files/README.md b/samples/client/others/csharp-netcore-complex-files/README.md index 1332821c892a..3ce44751c071 100644 --- a/samples/client/others/csharp-netcore-complex-files/README.md +++ b/samples/client/others/csharp-netcore-complex-files/README.md @@ -109,11 +109,11 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.InlineObject](docs/InlineObject.md) - - [Model.InlineObject1](docs/InlineObject1.md) - - [Model.InlineObject2](docs/InlineObject2.md) - - [Model.MultipartMixedMarker](docs/MultipartMixedMarker.md) + - [Model.MultipartArrayRequest](docs/MultipartArrayRequest.md) + - [Model.MultipartMixedRequest](docs/MultipartMixedRequest.md) + - [Model.MultipartMixedRequestMarker](docs/MultipartMixedRequestMarker.md) - [Model.MultipartMixedStatus](docs/MultipartMixedStatus.md) + - [Model.MultipartSingleRequest](docs/MultipartSingleRequest.md) diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md index 72ec32d7193d..3ba52ec63112 100644 --- a/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md @@ -80,7 +80,7 @@ No authorization required # **MultipartMixed** -> void MultipartMixed (MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = null) +> void MultipartMixed (MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = null) @@ -105,7 +105,7 @@ namespace Example var apiInstance = new MultipartApi(config); var status = (MultipartMixedStatus) "ALLOWED"; // MultipartMixedStatus | var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | a file - var marker = new MultipartMixedMarker(); // MultipartMixedMarker | (optional) + var marker = new MultipartMixedRequestMarker(); // MultipartMixedRequestMarker | (optional) try { @@ -128,7 +128,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **MultipartMixedStatus**| | **file** | **System.IO.Stream****System.IO.Stream**| a file | - **marker** | [**MultipartMixedMarker**](MultipartMixedMarker.md)| | [optional] + **marker** | [**MultipartMixedRequestMarker**](MultipartMixedRequestMarker.md)| | [optional] ### Return type diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartArrayRequest.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartArrayRequest.md new file mode 100644 index 000000000000..3c8202425d12 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartArrayRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MultipartArrayRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Files** | **List<System.IO.Stream>** | Many files | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequest.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequest.md new file mode 100644 index 000000000000..f99207cd27c5 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.MultipartMixedRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **MultipartMixedStatus** | | +**Marker** | [**MultipartMixedRequestMarker**](MultipartMixedRequestMarker.md) | | [optional] +**File** | **System.IO.Stream** | a file | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequestMarker.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequestMarker.md new file mode 100644 index 000000000000..82cca765791c --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartMixedRequestMarker.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.MultipartMixedRequestMarker +additional object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartSingleRequest.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartSingleRequest.md new file mode 100644 index 000000000000..9735d657d551 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartSingleRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MultipartSingleRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | **System.IO.Stream** | One file | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartArrayRequestTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartArrayRequestTests.cs new file mode 100644 index 000000000000..177c1b076408 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartArrayRequestTests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + ///

+ /// Class for testing MultipartArrayRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultipartArrayRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MultipartArrayRequest + //private MultipartArrayRequest instance; + + public MultipartArrayRequestTests() + { + // TODO uncomment below to create an instance of MultipartArrayRequest + //instance = new MultipartArrayRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartArrayRequest + /// + [Fact] + public void MultipartArrayRequestInstanceTest() + { + // TODO uncomment below to test "IsType" MultipartArrayRequest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestMarkerTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestMarkerTests.cs new file mode 100644 index 000000000000..7657e49a97ba --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestMarkerTests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MultipartMixedRequestMarker + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultipartMixedRequestMarkerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MultipartMixedRequestMarker + //private MultipartMixedRequestMarker instance; + + public MultipartMixedRequestMarkerTests() + { + // TODO uncomment below to create an instance of MultipartMixedRequestMarker + //instance = new MultipartMixedRequestMarker(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartMixedRequestMarker + /// + [Fact] + public void MultipartMixedRequestMarkerInstanceTest() + { + // TODO uncomment below to test "IsType" MultipartMixedRequestMarker + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestTests.cs new file mode 100644 index 000000000000..99c381d0dfd9 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartMixedRequestTests.cs @@ -0,0 +1,86 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MultipartMixedRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultipartMixedRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MultipartMixedRequest + //private MultipartMixedRequest instance; + + public MultipartMixedRequestTests() + { + // TODO uncomment below to create an instance of MultipartMixedRequest + //instance = new MultipartMixedRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartMixedRequest + /// + [Fact] + public void MultipartMixedRequestInstanceTest() + { + // TODO uncomment below to test "IsType" MultipartMixedRequest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Marker' + /// + [Fact] + public void MarkerTest() + { + // TODO unit test for the property 'Marker' + } + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartSingleRequestTests.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartSingleRequestTests.cs new file mode 100644 index 000000000000..445e118e3b24 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Model/MultipartSingleRequestTests.cs @@ -0,0 +1,70 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MultipartSingleRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MultipartSingleRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MultipartSingleRequest + //private MultipartSingleRequest instance; + + public MultipartSingleRequestTests() + { + // TODO uncomment below to create an instance of MultipartSingleRequest + //instance = new MultipartSingleRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MultipartSingleRequest + /// + [Fact] + public void MultipartSingleRequestInstanceTest() + { + // TODO uncomment below to test "IsType" MultipartSingleRequest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs index f503f31306d1..1c160451c536 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs @@ -61,7 +61,7 @@ public interface IMultipartApiSync : IApiAccessor /// (optional) /// Index associated with the operation. /// - void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0); + void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0); /// /// @@ -75,7 +75,7 @@ public interface IMultipartApiSync : IApiAccessor /// (optional) /// Index associated with the operation. /// ApiResponse of Object(void) - ApiResponse MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0); + ApiResponse MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0); /// /// /// @@ -146,7 +146,7 @@ public interface IMultipartApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -161,7 +161,7 @@ public interface IMultipartApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -458,7 +458,7 @@ public async System.Threading.Tasks.Task (optional) /// Index associated with the operation. /// - public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0) + public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0) { MultipartMixedWithHttpInfo(status, file, marker); } @@ -472,7 +472,7 @@ public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, M /// (optional) /// Index associated with the operation. /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0) { // verify the required parameter 'file' is set if (file == null) @@ -537,7 +537,7 @@ public Org.OpenAPITools.Client.ApiResponse MultipartMixedWithHttpInfo(Mu /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await MultipartMixedWithHttpInfoAsync(status, file, marker, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -552,7 +552,7 @@ public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatu /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'file' is set if (file == null) diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs new file mode 100644 index 000000000000..60083edbb16d --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs @@ -0,0 +1,121 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MultipartArrayRequest + /// + [DataContract(Name = "multipartArray_request")] + public partial class MultipartArrayRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Many files. + public MultipartArrayRequest(List files = default(List)) + { + this.Files = files; + } + + /// + /// Many files + /// + /// Many files + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MultipartArrayRequest {\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartArrayRequest).AreEqual; + } + + /// + /// Returns true if MultipartArrayRequest instances are equal + /// + /// Instance of MultipartArrayRequest to be compared + /// Boolean + public bool Equals(MultipartArrayRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs new file mode 100644 index 000000000000..e10540680961 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs @@ -0,0 +1,154 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MultipartMixedRequest + /// + [DataContract(Name = "multipartMixed_request")] + public partial class MultipartMixedRequest : IEquatable, IValidatableObject + { + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)] + public MultipartMixedStatus Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MultipartMixedRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// status (required). + /// marker. + /// a file (required). + public MultipartMixedRequest(MultipartMixedStatus status = default(MultipartMixedStatus), MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), System.IO.Stream file = default(System.IO.Stream)) + { + this.Status = status; + // to ensure "file" is required (not null) + if (file == null) + { + throw new ArgumentNullException("file is a required property for MultipartMixedRequest and cannot be null"); + } + this.File = file; + this.Marker = marker; + } + + /// + /// Gets or Sets Marker + /// + [DataMember(Name = "marker", EmitDefaultValue = false)] + public MultipartMixedRequestMarker Marker { get; set; } + + /// + /// a file + /// + /// a file + [DataMember(Name = "file", IsRequired = true, EmitDefaultValue = false)] + public System.IO.Stream File { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MultipartMixedRequest {\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Marker: ").Append(Marker).Append("\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartMixedRequest).AreEqual; + } + + /// + /// Returns true if MultipartMixedRequest instances are equal + /// + /// Instance of MultipartMixedRequest to be compared + /// Boolean + public bool Equals(MultipartMixedRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.Marker != null) + { + hashCode = (hashCode * 59) + this.Marker.GetHashCode(); + } + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs new file mode 100644 index 000000000000..8e708aa76d5f --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs @@ -0,0 +1,120 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// additional object + /// + [DataContract(Name = "multipartMixed_request_marker")] + public partial class MultipartMixedRequestMarker : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public MultipartMixedRequestMarker(string name = default(string)) + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MultipartMixedRequestMarker {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartMixedRequestMarker).AreEqual; + } + + /// + /// Returns true if MultipartMixedRequestMarker instances are equal + /// + /// Instance of MultipartMixedRequestMarker to be compared + /// Boolean + public bool Equals(MultipartMixedRequestMarker input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs new file mode 100644 index 000000000000..76f7baae15e5 --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs @@ -0,0 +1,121 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MultipartSingleRequest + /// + [DataContract(Name = "multipartSingle_request")] + public partial class MultipartSingleRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// One file. + public MultipartSingleRequest(System.IO.Stream file = default(System.IO.Stream)) + { + this.File = file; + } + + /// + /// One file + /// + /// One file + [DataMember(Name = "file", EmitDefaultValue = false)] + public System.IO.Stream File { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MultipartSingleRequest {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartSingleRequest).AreEqual; + } + + /// + /// Returns true if MultipartSingleRequest instances are equal + /// + /// Instance of MultipartSingleRequest to be compared + /// Boolean + public bool Equals(MultipartSingleRequest input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 3d2b8a39e045..0f760ad7305f 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -242,13 +242,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -275,14 +269,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -731,24 +718,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -791,77 +761,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -970,16 +870,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1172,16 +1063,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2086,6 +1968,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 3d2b8a39e045..0f760ad7305f 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -242,13 +242,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -275,14 +269,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -731,24 +718,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -791,77 +761,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -970,16 +870,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1172,16 +1063,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2086,6 +1968,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index f90b0a7d9ab0..32235895732e 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -271,18 +271,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "200": description: Successful operation @@ -312,19 +304,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -814,29 +797,10 @@ paths: type: array style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -872,81 +836,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -1074,21 +967,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1287,21 +1169,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1391,36 +1262,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2136,7 +1977,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2145,7 +1986,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2155,7 +1996,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2175,7 +2016,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2247,7 +2088,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2259,7 +2100,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/client/petstore/java/google-api-client/api/openapi.yaml b/samples/client/petstore/java/google-api-client/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/google-api-client/api/openapi.yaml +++ b/samples/client/petstore/java/google-api-client/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey1/api/openapi.yaml b/samples/client/petstore/java/jersey1/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/jersey1/api/openapi.yaml +++ b/samples/client/petstore/java/jersey1/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index 6e508514df84..dad28120951c 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -262,18 +262,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -301,19 +293,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -794,29 +777,10 @@ paths: type: number style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -852,83 +816,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -1034,21 +925,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1209,21 +1089,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1302,36 +1171,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2305,7 +2144,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2314,7 +2153,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2324,7 +2163,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2344,7 +2183,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2418,7 +2257,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2430,7 +2269,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 002737f54998..8c9106313282 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -12,7 +12,7 @@ docs/Apple.md docs/AppleReq.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfInlineAllOf.md -docs/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.md +docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md docs/Banana.md @@ -133,7 +133,7 @@ src/main/java/org/openapitools/client/model/Apple.java src/main/java/org/openapitools/client/model/AppleReq.java src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java -src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.java +src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java src/main/java/org/openapitools/client/model/ArrayTest.java src/main/java/org/openapitools/client/model/Banana.java diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index d1dbd67d76e4..dd5029167283 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -162,7 +162,7 @@ Class | Method | HTTP request | Description - [AppleReq](docs/AppleReq.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfInlineAllOf](docs/ArrayOfInlineAllOf.md) - - [ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1](docs/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.md) + - [ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf](docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Banana](docs/Banana.md) diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index fbdf8afb60cc..034de2409532 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -262,18 +262,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -301,19 +293,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -794,29 +777,10 @@ paths: type: number style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -852,83 +816,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -1034,21 +925,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1209,21 +1089,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1302,36 +1171,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2344,7 +2183,7 @@ components: items: allOf: - $ref: '#/components/schemas/Dog_allOf' - - $ref: '#/components/schemas/ArrayOfInlineAllOf_array_allof_dog_propertyItems_allOf_1' + - $ref: '#/components/schemas/ArrayOfInlineAllOf_array_allof_dog_property_inner_allOf' type: array required: - name @@ -2357,7 +2196,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2366,7 +2205,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2376,7 +2215,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2396,7 +2235,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2470,7 +2309,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2482,7 +2321,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2504,7 +2343,7 @@ components: declawed: type: boolean type: object - ArrayOfInlineAllOf_array_allof_dog_propertyItems_allOf_1: + ArrayOfInlineAllOf_array_allof_dog_property_inner_allOf: properties: color: type: string diff --git a/samples/client/petstore/java/okhttp-gson/docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md new file mode 100644 index 000000000000..4ec0e1638567 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.md @@ -0,0 +1,13 @@ + + +# ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index be47795aa72a..2aae2cb9ac34 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -225,7 +225,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri .registerTypeAdapterFactory(new org.openapitools.client.model.AppleReq.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfInlineAllOf.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Banana.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java index 48fb48ddeb4a..22ce1bf264ab 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1; +import org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf; import org.openapitools.client.model.DogAllOf; import com.google.gson.Gson; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java new file mode 100644 index 000000000000..e5deb94852ba --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java @@ -0,0 +1,273 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf { + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color; + + public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf() { + } + + public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf arrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf = (ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf) o; + return Objects.equals(this.color, arrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.color)&& + Objects.equals(this.additionalProperties, arrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(color, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf {\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf is not found in the empty JSON string", ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.openapiRequiredFields.toString())); + } + } + if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additonal properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else { // non-primitive type + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + */ + public static ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.class); + } + + /** + * Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOfTest.java new file mode 100644 index 000000000000..0e79cdfb0004 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOfTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + */ +public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOfTest { + private final ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf model = new ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf(); + + /** + * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + */ + @Test + public void testArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf() { + // TODO: test ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/rest-assured/api/openapi.yaml b/samples/client/petstore/java/rest-assured/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/rest-assured/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2/api/openapi.yaml b/samples/client/petstore/java/retrofit2/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/retrofit2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 9652c1b4a8c5..3ded94aeafc2 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -250,13 +250,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -285,14 +279,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -763,24 +750,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -827,77 +797,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1016,16 +916,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1231,16 +1122,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2147,6 +2029,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index f90b0a7d9ab0..32235895732e 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -271,18 +271,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "200": description: Successful operation @@ -312,19 +304,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -814,29 +797,10 @@ paths: type: array style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -872,81 +836,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -1074,21 +967,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1287,21 +1169,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1391,36 +1262,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2136,7 +1977,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2145,7 +1986,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2155,7 +1996,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2175,7 +2016,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2247,7 +2088,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2259,7 +2100,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/client/petstore/php-dt-modern/.openapi-generator/FILES b/samples/client/petstore/php-dt-modern/.openapi-generator/FILES index b1c5f88c6f89..feb56a129c80 100644 --- a/samples/client/petstore/php-dt-modern/.openapi-generator/FILES +++ b/samples/client/petstore/php-dt-modern/.openapi-generator/FILES @@ -50,13 +50,13 @@ src/App/DTO/FindPetsByTagsParameterData.php src/App/DTO/GetOrderByIdParameterData.php src/App/DTO/GetPetByIdParameterData.php src/App/DTO/GetUserByNameParameterData.php -src/App/DTO/InlineObject.php -src/App/DTO/InlineObject1.php src/App/DTO/LoginUserParameterData.php src/App/DTO/Order.php src/App/DTO/Pet.php src/App/DTO/Tag.php src/App/DTO/UpdatePetWithFormParameterData.php +src/App/DTO/UpdatePetWithFormRequest.php src/App/DTO/UpdateUserParameterData.php src/App/DTO/UploadFileParameterData.php +src/App/DTO/UploadFileRequest.php src/App/DTO/User.php diff --git a/samples/client/petstore/php-dt-modern/src/App/ApiClient.php b/samples/client/petstore/php-dt-modern/src/App/ApiClient.php index b4e56f6f9da7..32c4b83d7df9 100644 --- a/samples/client/petstore/php-dt-modern/src/App/ApiClient.php +++ b/samples/client/petstore/php-dt-modern/src/App/ApiClient.php @@ -1230,7 +1230,7 @@ public function updatePetResult( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return ResponseInterface @@ -1239,7 +1239,7 @@ public function updatePetResult( */ public function updatePetWithFormRaw( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ): ResponseInterface @@ -1253,7 +1253,7 @@ public function updatePetWithFormRaw( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return array @@ -1263,7 +1263,7 @@ public function updatePetWithFormRaw( */ public function updatePetWithForm( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ): array @@ -1283,7 +1283,7 @@ public function updatePetWithForm( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return mixed @@ -1294,7 +1294,7 @@ public function updatePetWithForm( */ public function updatePetWithFormResult( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ): mixed @@ -1387,7 +1387,7 @@ public function updateUserResult( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1397,7 +1397,7 @@ public function updateUserResult( */ public function uploadFileRaw( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' @@ -1413,7 +1413,7 @@ public function uploadFileRaw( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1424,7 +1424,7 @@ public function uploadFileRaw( */ public function uploadFile( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' @@ -1446,7 +1446,7 @@ public function uploadFile( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1458,7 +1458,7 @@ public function uploadFile( */ public function uploadFileResult( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' diff --git a/samples/client/petstore/php-dt-modern/src/App/DTO/UpdatePetWithFormRequest.php b/samples/client/petstore/php-dt-modern/src/App/DTO/UpdatePetWithFormRequest.php new file mode 100644 index 000000000000..6245c319f958 --- /dev/null +++ b/samples/client/petstore/php-dt-modern/src/App/DTO/UpdatePetWithFormRequest.php @@ -0,0 +1,24 @@ + "string"])] + public string|null $name = null; + + /** + * Updated status of the pet + */ + #[DTA\Data(field: "status", nullable: true)] + #[DTA\Validator("Scalar", ["type" => "string"])] + public string|null $status = null; + +} diff --git a/samples/client/petstore/php-dt-modern/src/App/DTO/UploadFileRequest.php b/samples/client/petstore/php-dt-modern/src/App/DTO/UploadFileRequest.php new file mode 100644 index 000000000000..c04d6e60c167 --- /dev/null +++ b/samples/client/petstore/php-dt-modern/src/App/DTO/UploadFileRequest.php @@ -0,0 +1,25 @@ + "string"])] + public string|null $additional_metadata = null; + + /** + * file to upload + */ + #[DTA\Data(field: "file", nullable: true)] + #[DTA\Strategy("Object", ["type" => \SplFileObject::class])] + #[DTA\Validator("TypeCompliant", ["type" => \SplFileObject::class])] + public \SplFileObject|null $file = null; + +} diff --git a/samples/client/petstore/php-dt/.openapi-generator/FILES b/samples/client/petstore/php-dt/.openapi-generator/FILES index b1c5f88c6f89..feb56a129c80 100644 --- a/samples/client/petstore/php-dt/.openapi-generator/FILES +++ b/samples/client/petstore/php-dt/.openapi-generator/FILES @@ -50,13 +50,13 @@ src/App/DTO/FindPetsByTagsParameterData.php src/App/DTO/GetOrderByIdParameterData.php src/App/DTO/GetPetByIdParameterData.php src/App/DTO/GetUserByNameParameterData.php -src/App/DTO/InlineObject.php -src/App/DTO/InlineObject1.php src/App/DTO/LoginUserParameterData.php src/App/DTO/Order.php src/App/DTO/Pet.php src/App/DTO/Tag.php src/App/DTO/UpdatePetWithFormParameterData.php +src/App/DTO/UpdatePetWithFormRequest.php src/App/DTO/UpdateUserParameterData.php src/App/DTO/UploadFileParameterData.php +src/App/DTO/UploadFileRequest.php src/App/DTO/User.php diff --git a/samples/client/petstore/php-dt/src/App/ApiClient.php b/samples/client/petstore/php-dt/src/App/ApiClient.php index 2ad89d55ad64..f103a5eb30e4 100644 --- a/samples/client/petstore/php-dt/src/App/ApiClient.php +++ b/samples/client/petstore/php-dt/src/App/ApiClient.php @@ -1230,7 +1230,7 @@ public function updatePetResult( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return ResponseInterface @@ -1239,7 +1239,7 @@ public function updatePetResult( */ public function updatePetWithFormRaw( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ): ResponseInterface @@ -1253,7 +1253,7 @@ public function updatePetWithFormRaw( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return array @@ -1263,7 +1263,7 @@ public function updatePetWithFormRaw( */ public function updatePetWithForm( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ): array @@ -1283,7 +1283,7 @@ public function updatePetWithForm( /** * Updates a pet in the store with form data * @param \App\DTO\UpdatePetWithFormParameterData $parameters - * @param \App\DTO\InlineObject $requestContent + * @param \App\DTO\UpdatePetWithFormRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @return mixed @@ -1294,7 +1294,7 @@ public function updatePetWithForm( */ public function updatePetWithFormResult( \App\DTO\UpdatePetWithFormParameterData $parameters, - \App\DTO\InlineObject $requestContent, + \App\DTO\UpdatePetWithFormRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'application/x-www-form-urlencoded' ) @@ -1387,7 +1387,7 @@ public function updateUserResult( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1397,7 +1397,7 @@ public function updateUserResult( */ public function uploadFileRaw( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' @@ -1413,7 +1413,7 @@ public function uploadFileRaw( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1424,7 +1424,7 @@ public function uploadFileRaw( */ public function uploadFile( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' @@ -1446,7 +1446,7 @@ public function uploadFile( /** * uploads an image * @param \App\DTO\UploadFileParameterData $parameters - * @param \App\DTO\InlineObject1 $requestContent + * @param \App\DTO\UploadFileRequest $requestContent * @param iterable|string[][] $security * @param string $requestMediaType * @param string $responseMediaType @@ -1458,7 +1458,7 @@ public function uploadFile( */ public function uploadFileResult( \App\DTO\UploadFileParameterData $parameters, - \App\DTO\InlineObject1 $requestContent, + \App\DTO\UploadFileRequest $requestContent, iterable $security = ['petstore_auth' => ['write:pets', 'read:pets', ]], string $requestMediaType = 'multipart/form-data', string $responseMediaType = 'application/json' diff --git a/samples/client/petstore/php-dt/src/App/DTO/UpdatePetWithFormRequest.php b/samples/client/petstore/php-dt/src/App/DTO/UpdatePetWithFormRequest.php new file mode 100644 index 000000000000..e976a6a9cde2 --- /dev/null +++ b/samples/client/petstore/php-dt/src/App/DTO/UpdatePetWithFormRequest.php @@ -0,0 +1,28 @@ + => { + filePost: async (inlineRequest2?: InlineRequest2, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/file`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -209,7 +254,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(inlineObject, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(inlineRequest2, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -218,11 +263,11 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati }, /** * - * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {InlineRequest1} [inlineRequest1] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsFilteredPatch: async (petByAgePetByType?: PetByAge | PetByType, options: AxiosRequestConfig = {}): Promise => { + petsFilteredPatch: async (inlineRequest1?: InlineRequest1, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/pets-filtered`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -242,7 +287,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(petByAgePetByType, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(inlineRequest1, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -251,11 +296,11 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati }, /** * - * @param {Cat | Dog} [catDog] + * @param {InlineRequest} [inlineRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsPatch: async (catDog?: Cat | Dog, options: AxiosRequestConfig = {}): Promise => { + petsPatch: async (inlineRequest?: InlineRequest, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/pets`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -275,7 +320,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(catDog, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(inlineRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -294,32 +339,32 @@ export const DefaultApiFp = function(configuration?: Configuration) { return { /** * - * @param {InlineObject} [inlineObject] + * @param {InlineRequest2} [inlineRequest2] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async filePost(inlineObject?: InlineObject, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.filePost(inlineObject, options); + async filePost(inlineRequest2?: InlineRequest2, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.filePost(inlineRequest2, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * - * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {InlineRequest1} [inlineRequest1] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.petsFilteredPatch(petByAgePetByType, options); + async petsFilteredPatch(inlineRequest1?: InlineRequest1, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.petsFilteredPatch(inlineRequest1, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * - * @param {Cat | Dog} [catDog] + * @param {InlineRequest} [inlineRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async petsPatch(catDog?: Cat | Dog, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.petsPatch(catDog, options); + async petsPatch(inlineRequest?: InlineRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.petsPatch(inlineRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -334,30 +379,30 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa return { /** * - * @param {InlineObject} [inlineObject] + * @param {InlineRequest2} [inlineRequest2] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filePost(inlineObject?: InlineObject, options?: any): AxiosPromise { - return localVarFp.filePost(inlineObject, options).then((request) => request(axios, basePath)); + filePost(inlineRequest2?: InlineRequest2, options?: any): AxiosPromise { + return localVarFp.filePost(inlineRequest2, options).then((request) => request(axios, basePath)); }, /** * - * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {InlineRequest1} [inlineRequest1] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any): AxiosPromise { - return localVarFp.petsFilteredPatch(petByAgePetByType, options).then((request) => request(axios, basePath)); + petsFilteredPatch(inlineRequest1?: InlineRequest1, options?: any): AxiosPromise { + return localVarFp.petsFilteredPatch(inlineRequest1, options).then((request) => request(axios, basePath)); }, /** * - * @param {Cat | Dog} [catDog] + * @param {InlineRequest} [inlineRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsPatch(catDog?: Cat | Dog, options?: any): AxiosPromise { - return localVarFp.petsPatch(catDog, options).then((request) => request(axios, basePath)); + petsPatch(inlineRequest?: InlineRequest, options?: any): AxiosPromise { + return localVarFp.petsPatch(inlineRequest, options).then((request) => request(axios, basePath)); }, }; }; @@ -371,35 +416,35 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa export class DefaultApi extends BaseAPI { /** * - * @param {InlineObject} [inlineObject] + * @param {InlineRequest2} [inlineRequest2] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ - public filePost(inlineObject?: InlineObject, options?: AxiosRequestConfig) { - return DefaultApiFp(this.configuration).filePost(inlineObject, options).then((request) => request(this.axios, this.basePath)); + public filePost(inlineRequest2?: InlineRequest2, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).filePost(inlineRequest2, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {InlineRequest1} [inlineRequest1] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ - public petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: AxiosRequestConfig) { - return DefaultApiFp(this.configuration).petsFilteredPatch(petByAgePetByType, options).then((request) => request(this.axios, this.basePath)); + public petsFilteredPatch(inlineRequest1?: InlineRequest1, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).petsFilteredPatch(inlineRequest1, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {Cat | Dog} [catDog] + * @param {InlineRequest} [inlineRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ - public petsPatch(catDog?: Cat | Dog, options?: AxiosRequestConfig) { - return DefaultApiFp(this.configuration).petsPatch(catDog, options).then((request) => request(this.axios, this.basePath)); + public petsPatch(inlineRequest?: InlineRequest, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).petsPatch(inlineRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES index 336206328ced..3616189dc870 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES @@ -2,7 +2,7 @@ apis/DefaultApi.ts apis/index.ts index.ts models/EnumPatternObject.ts -models/InlineObject.ts +models/FakeEnumRequestPostInlineRequest.ts models/InlineResponse200.ts models/NumberEnum.ts models/StringEnum.ts diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index c79c081b13f2..3d55e7a55ca5 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -18,9 +18,9 @@ import { EnumPatternObject, EnumPatternObjectFromJSON, EnumPatternObjectToJSON, - InlineObject, - InlineObjectFromJSON, - InlineObjectToJSON, + FakeEnumRequestPostInlineRequest, + FakeEnumRequestPostInlineRequestFromJSON, + FakeEnumRequestPostInlineRequestToJSON, InlineResponse200, InlineResponse200FromJSON, InlineResponse200ToJSON, @@ -46,8 +46,8 @@ export interface FakeEnumRequestGetRefRequest { nullableNumberEnum?: NumberEnum | null; } -export interface FakeEnumRequestPostInlineRequest { - inlineObject?: InlineObject; +export interface FakeEnumRequestPostInlineOperationRequest { + fakeEnumRequestPostInlineRequest?: FakeEnumRequestPostInlineRequest; } export interface FakeEnumRequestPostRefRequest { @@ -141,7 +141,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostInlineRaw(requestParameters: FakeEnumRequestPostInlineRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise> { + async fakeEnumRequestPostInlineRaw(requestParameters: FakeEnumRequestPostInlineOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -153,15 +153,15 @@ export class DefaultApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: InlineObjectToJSON(requestParameters.inlineObject), + body: FakeEnumRequestPostInlineRequestToJSON(requestParameters.fakeEnumRequestPostInlineRequest), }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => InlineObjectFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue)); } /** */ - async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest = {}, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise { + async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise { const response = await this.fakeEnumRequestPostInlineRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts new file mode 100644 index 000000000000..ea6fee11aa78 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Enum test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface FakeEnumRequestPostInlineRequest + */ +export interface FakeEnumRequestPostInlineRequest { + /** + * + * @type {string} + * @memberof FakeEnumRequestPostInlineRequest + */ + stringEnum?: FakeEnumRequestPostInlineRequestStringEnumEnum; + /** + * + * @type {string} + * @memberof FakeEnumRequestPostInlineRequest + */ + nullableStringEnum?: FakeEnumRequestPostInlineRequestNullableStringEnumEnum; + /** + * + * @type {number} + * @memberof FakeEnumRequestPostInlineRequest + */ + numberEnum?: FakeEnumRequestPostInlineRequestNumberEnumEnum; + /** + * + * @type {number} + * @memberof FakeEnumRequestPostInlineRequest + */ + nullableNumberEnum?: FakeEnumRequestPostInlineRequestNullableNumberEnumEnum; +} + + +/** + * @export + */ +export const FakeEnumRequestPostInlineRequestStringEnumEnum = { + One: 'one', + Two: 'two', + Three: 'three' +} as const; +export type FakeEnumRequestPostInlineRequestStringEnumEnum = typeof FakeEnumRequestPostInlineRequestStringEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestStringEnumEnum]; + +/** + * @export + */ +export const FakeEnumRequestPostInlineRequestNullableStringEnumEnum = { + One: 'one', + Two: 'two', + Three: 'three' +} as const; +export type FakeEnumRequestPostInlineRequestNullableStringEnumEnum = typeof FakeEnumRequestPostInlineRequestNullableStringEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNullableStringEnumEnum]; + +/** + * @export + */ +export const FakeEnumRequestPostInlineRequestNumberEnumEnum = { + NUMBER_1: 1, + NUMBER_2: 2, + NUMBER_3: 3 +} as const; +export type FakeEnumRequestPostInlineRequestNumberEnumEnum = typeof FakeEnumRequestPostInlineRequestNumberEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNumberEnumEnum]; + +/** + * @export + */ +export const FakeEnumRequestPostInlineRequestNullableNumberEnumEnum = { + NUMBER_1: 1, + NUMBER_2: 2, + NUMBER_3: 3 +} as const; +export type FakeEnumRequestPostInlineRequestNullableNumberEnumEnum = typeof FakeEnumRequestPostInlineRequestNullableNumberEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNullableNumberEnumEnum]; + + +export function FakeEnumRequestPostInlineRequestFromJSON(json: any): FakeEnumRequestPostInlineRequest { + return FakeEnumRequestPostInlineRequestFromJSONTyped(json, false); +} + +export function FakeEnumRequestPostInlineRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FakeEnumRequestPostInlineRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'stringEnum': !exists(json, 'string-enum') ? undefined : json['string-enum'], + 'nullableStringEnum': !exists(json, 'nullable-string-enum') ? undefined : json['nullable-string-enum'], + 'numberEnum': !exists(json, 'number-enum') ? undefined : json['number-enum'], + 'nullableNumberEnum': !exists(json, 'nullable-number-enum') ? undefined : json['nullable-number-enum'], + }; +} + +export function FakeEnumRequestPostInlineRequestToJSON(value?: FakeEnumRequestPostInlineRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'string-enum': value.stringEnum, + 'nullable-string-enum': value.nullableStringEnum, + 'number-enum': value.numberEnum, + 'nullable-number-enum': value.nullableNumberEnum, + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/index.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/index.ts index ee4474785e1a..bad4b323c7f7 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/index.ts @@ -1,7 +1,7 @@ /* tslint:disable */ /* eslint-disable */ export * from './EnumPatternObject'; -export * from './InlineObject'; +export * from './FakeEnumRequestPostInlineRequest'; export * from './InlineResponse200'; export * from './NumberEnum'; export * from './StringEnum'; diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES index 336206328ced..3616189dc870 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES @@ -2,7 +2,7 @@ apis/DefaultApi.ts apis/index.ts index.ts models/EnumPatternObject.ts -models/InlineObject.ts +models/FakeEnumRequestPostInlineRequest.ts models/InlineResponse200.ts models/NumberEnum.ts models/StringEnum.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts index 9954869c17f4..86fe32107ac7 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts @@ -18,9 +18,9 @@ import { EnumPatternObject, EnumPatternObjectFromJSON, EnumPatternObjectToJSON, - InlineObject, - InlineObjectFromJSON, - InlineObjectToJSON, + FakeEnumRequestPostInlineRequest, + FakeEnumRequestPostInlineRequestFromJSON, + FakeEnumRequestPostInlineRequestToJSON, InlineResponse200, InlineResponse200FromJSON, InlineResponse200ToJSON, @@ -46,8 +46,8 @@ export interface FakeEnumRequestGetRefRequest { nullableNumberEnum?: NumberEnum | null; } -export interface FakeEnumRequestPostInlineRequest { - inlineObject?: InlineObject; +export interface FakeEnumRequestPostInlineOperationRequest { + fakeEnumRequestPostInlineRequest?: FakeEnumRequestPostInlineRequest; } export interface FakeEnumRequestPostRefRequest { @@ -141,7 +141,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostInlineRaw(requestParameters: FakeEnumRequestPostInlineRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise> { + async fakeEnumRequestPostInlineRaw(requestParameters: FakeEnumRequestPostInlineOperationRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -153,15 +153,15 @@ export class DefaultApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: InlineObjectToJSON(requestParameters.inlineObject), + body: FakeEnumRequestPostInlineRequestToJSON(requestParameters.fakeEnumRequestPostInlineRequest), }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => InlineObjectFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue)); } /** */ - async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest = {}, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise { + async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise { const response = await this.fakeEnumRequestPostInlineRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestPostInlineRequest.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestPostInlineRequest.ts new file mode 100644 index 000000000000..c27671d88bf7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestPostInlineRequest.ts @@ -0,0 +1,118 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Enum test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface FakeEnumRequestPostInlineRequest + */ +export interface FakeEnumRequestPostInlineRequest { + /** + * + * @type {string} + * @memberof FakeEnumRequestPostInlineRequest + */ + stringEnum?: FakeEnumRequestPostInlineRequestStringEnumEnum; + /** + * + * @type {string} + * @memberof FakeEnumRequestPostInlineRequest + */ + nullableStringEnum?: FakeEnumRequestPostInlineRequestNullableStringEnumEnum; + /** + * + * @type {number} + * @memberof FakeEnumRequestPostInlineRequest + */ + numberEnum?: FakeEnumRequestPostInlineRequestNumberEnumEnum; + /** + * + * @type {number} + * @memberof FakeEnumRequestPostInlineRequest + */ + nullableNumberEnum?: FakeEnumRequestPostInlineRequestNullableNumberEnumEnum; +} + +/** +* @export +* @enum {string} +*/ +export enum FakeEnumRequestPostInlineRequestStringEnumEnum { + One = 'one', + Two = 'two', + Three = 'three' +} +/** +* @export +* @enum {string} +*/ +export enum FakeEnumRequestPostInlineRequestNullableStringEnumEnum { + One = 'one', + Two = 'two', + Three = 'three' +} +/** +* @export +* @enum {string} +*/ +export enum FakeEnumRequestPostInlineRequestNumberEnumEnum { + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} +/** +* @export +* @enum {string} +*/ +export enum FakeEnumRequestPostInlineRequestNullableNumberEnumEnum { + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} + + +export function FakeEnumRequestPostInlineRequestFromJSON(json: any): FakeEnumRequestPostInlineRequest { + return FakeEnumRequestPostInlineRequestFromJSONTyped(json, false); +} + +export function FakeEnumRequestPostInlineRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FakeEnumRequestPostInlineRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'stringEnum': !exists(json, 'string-enum') ? undefined : json['string-enum'], + 'nullableStringEnum': !exists(json, 'nullable-string-enum') ? undefined : json['nullable-string-enum'], + 'numberEnum': !exists(json, 'number-enum') ? undefined : json['number-enum'], + 'nullableNumberEnum': !exists(json, 'nullable-number-enum') ? undefined : json['nullable-number-enum'], + }; +} + +export function FakeEnumRequestPostInlineRequestToJSON(value?: FakeEnumRequestPostInlineRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'string-enum': value.stringEnum, + 'nullable-string-enum': value.nullableStringEnum, + 'number-enum': value.numberEnum, + 'nullable-number-enum': value.nullableNumberEnum, + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/index.ts index ee4474785e1a..bad4b323c7f7 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/index.ts @@ -1,7 +1,7 @@ /* tslint:disable */ /* eslint-disable */ export * from './EnumPatternObject'; -export * from './InlineObject'; +export * from './FakeEnumRequestPostInlineRequest'; export * from './InlineResponse200'; export * from './NumberEnum'; export * from './StringEnum'; diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 4790eaddd3cc..76744b15e4ad 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -265,18 +265,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -302,19 +294,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -773,29 +756,10 @@ paths: type: number style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -827,81 +791,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -997,21 +890,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1198,21 +1080,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1267,36 +1138,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2122,7 +1963,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2131,7 +1972,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2141,7 +1982,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2161,7 +2002,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2233,7 +2074,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2245,7 +2086,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 6e508514df84..dad28120951c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -262,18 +262,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -301,19 +293,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -794,29 +777,10 @@ paths: type: number style: form requestBody: - $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": description: Invalid request @@ -852,83 +816,10 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: - $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object + $ref: '#/components/schemas/testEndpointParameters_request' responses: "400": description: Invalid username supplied @@ -1034,21 +925,10 @@ paths: description: "" operationId: testJsonFormData requestBody: - $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object + $ref: '#/components/schemas/testJsonFormData_request' responses: "200": description: successful operation @@ -1209,21 +1089,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' responses: "200": content: @@ -1302,36 +1171,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' schemas: Foo: example: @@ -2305,7 +2144,7 @@ components: string: $ref: '#/components/schemas/Foo' type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -2314,7 +2153,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server @@ -2324,7 +2163,7 @@ components: format: binary type: string type: object - inline_object_2: + testEnumParameters_request: properties: enum_form_string_array: description: Form parameter enum test (string array) @@ -2344,7 +2183,7 @@ components: - (xyz) type: string type: object - inline_object_3: + testEndpointParameters_request: properties: integer: description: None @@ -2418,7 +2257,7 @@ components: - number - pattern_without_delimiter type: object - inline_object_4: + testJsonFormData_request: properties: param: description: field1 @@ -2430,7 +2269,7 @@ components: - param - param2 type: object - inline_object_5: + uploadFileWithRequiredFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index ce697552769f..90e36d7f34d0 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -41,7 +41,6 @@ docs/EnumTest.md docs/EquilateralTriangle.md docs/FakeApi.md docs/FakeClassnameTags123Api.md -docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md docs/File.md docs/FileSchemaTestClass.md docs/Foo.md @@ -55,7 +54,6 @@ docs/GrandparentAnimal.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/InlineAdditionalPropertiesRefPayload.md -docs/InlineObject6.md docs/InlineResponseDefault.md docs/IntegerEnum.md docs/IntegerEnumOneValue.md @@ -82,6 +80,8 @@ docs/ParentPet.md docs/Pet.md docs/PetApi.md docs/Pig.md +docs/PostInlineAdditionalPropertiesPayloadRequest.md +docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md docs/Quadrilateral.md docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md @@ -155,7 +155,6 @@ petstore_api/model/enum_arrays.py petstore_api/model/enum_class.py petstore_api/model/enum_test.py petstore_api/model/equilateral_triangle.py -petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py petstore_api/model/file.py petstore_api/model/file_schema_test_class.py petstore_api/model/foo.py @@ -169,7 +168,6 @@ petstore_api/model/grandparent_animal.py petstore_api/model/has_only_read_only.py petstore_api/model/health_check_result.py petstore_api/model/inline_additional_properties_ref_payload.py -petstore_api/model/inline_object6.py petstore_api/model/inline_response_default.py petstore_api/model/integer_enum.py petstore_api/model/integer_enum_one_value.py @@ -195,6 +193,8 @@ petstore_api/model/order.py petstore_api/model/parent_pet.py petstore_api/model/pet.py petstore_api/model/pig.py +petstore_api/model/post_inline_additional_properties_payload_request.py +petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py petstore_api/model/quadrilateral.py petstore_api/model/quadrilateral_interface.py petstore_api/model/read_only_first.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 4eaa47c54ee2..f5880f1528d5 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -170,7 +170,6 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [FakePostInlineAdditionalPropertiesPayloadArrayData](docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md) - [File](docs/File.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) @@ -184,7 +183,6 @@ Class | Method | HTTP request | Description - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) - [InlineAdditionalPropertiesRefPayload](docs/InlineAdditionalPropertiesRefPayload.md) - - [InlineObject6](docs/InlineObject6.md) - [InlineResponseDefault](docs/InlineResponseDefault.md) - [IntegerEnum](docs/IntegerEnum.md) - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) @@ -210,6 +208,8 @@ Class | Method | HTTP request | Description - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) + - [PostInlineAdditionalPropertiesPayloadRequest](docs/PostInlineAdditionalPropertiesPayloadRequest.md) + - [PostInlineAdditionalPropertiesPayloadRequestArrayDataInner](docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 17d46f8ba1c5..bd469c3c2aff 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -788,7 +788,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **post_inline_additional_properties_payload** -> InlineObject6 post_inline_additional_properties_payload() +> PostInlineAdditionalPropertiesPayloadRequest post_inline_additional_properties_payload() @@ -799,7 +799,7 @@ No authorization required import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model.inline_object6 import InlineObject6 +from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -812,20 +812,20 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - inline_object6 = InlineObject6( + post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( array_data=[ - FakePostInlineAdditionalPropertiesPayloadArrayData( + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner( labels=[ "labels_example", ], ), ], - ) # InlineObject6 | (optional) + ) # PostInlineAdditionalPropertiesPayloadRequest | (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.post_inline_additional_properties_payload(inline_object6=inline_object6) + api_response = api_instance.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->post_inline_additional_properties_payload: %s\n" % e) @@ -836,11 +836,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **inline_object6** | [**InlineObject6**](InlineObject6.md)| | [optional] + **post_inline_additional_properties_payload_request** | [**PostInlineAdditionalPropertiesPayloadRequest**](PostInlineAdditionalPropertiesPayloadRequest.md)| | [optional] ### Return type -[**InlineObject6**](InlineObject6.md) +[**PostInlineAdditionalPropertiesPayloadRequest**](PostInlineAdditionalPropertiesPayloadRequest.md) ### Authorization @@ -887,7 +887,7 @@ with petstore_api.ApiClient() as api_client: api_instance = fake_api.FakeApi(api_client) inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( array_data=[ - FakePostInlineAdditionalPropertiesPayloadArrayData( + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner( labels=[ "labels_example", ], diff --git a/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md b/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md index f99ed143d3f8..4f97b3de37ef 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md +++ b/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md @@ -5,7 +5,7 @@ this payload is used for verification that some model_to_dict issues are fixed ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.md) | | [optional] +**array_data** | [**[PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type**](PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md b/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md new file mode 100644 index 000000000000..096ff6a1827e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md @@ -0,0 +1,13 @@ +# PostInlineAdditionalPropertiesPayloadRequest + +this payload is used for verification that some model_to_dict issues are fixed + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_data** | [**[PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type**](PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md b/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md new file mode 100644 index 000000000000..4b093ce6de61 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md @@ -0,0 +1,12 @@ +# PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | **[str, none_type]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index e36e3b013121..f4206a5cd61d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -32,10 +32,10 @@ from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties from petstore_api.model.health_check_result import HealthCheckResult from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload -from petstore_api.model.inline_object6 import InlineObject6 from petstore_api.model.mammal import Mammal from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest from petstore_api.model.string_enum import StringEnum from petstore_api.model.user import User @@ -583,7 +583,7 @@ def __init__(self, api_client=None): ) self.post_inline_additional_properties_payload_endpoint = _Endpoint( settings={ - 'response_type': (InlineObject6,), + 'response_type': (PostInlineAdditionalPropertiesPayloadRequest,), 'auth': [], 'endpoint_path': '/fake/postInlineAdditionalPropertiesPayload', 'operation_id': 'post_inline_additional_properties_payload', @@ -592,7 +592,7 @@ def __init__(self, api_client=None): }, params_map={ 'all': [ - 'inline_object6', + 'post_inline_additional_properties_payload_request', ], 'required': [], 'nullable': [ @@ -608,13 +608,13 @@ def __init__(self, api_client=None): 'allowed_values': { }, 'openapi_types': { - 'inline_object6': - (InlineObject6,), + 'post_inline_additional_properties_payload_request': + (PostInlineAdditionalPropertiesPayloadRequest,), }, 'attribute_map': { }, 'location_map': { - 'inline_object6': 'body', + 'post_inline_additional_properties_payload_request': 'body', }, 'collection_format_map': { } @@ -2575,7 +2575,7 @@ def post_inline_additional_properties_payload( Keyword Args: - inline_object6 (InlineObject6): [optional] + post_inline_additional_properties_payload_request (PostInlineAdditionalPropertiesPayloadRequest): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -2608,7 +2608,7 @@ def post_inline_additional_properties_payload( async_req (bool): execute request asynchronously Returns: - InlineObject6 + PostInlineAdditionalPropertiesPayloadRequest If the method is called asynchronously, returns the request thread. """ diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py index 795e1dff8660..93902416ece9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py @@ -30,8 +30,8 @@ def lazy_import(): - from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData - globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner class InlineAdditionalPropertiesRefPayload(ModelNormal): @@ -87,7 +87,7 @@ def openapi_types(): """ lazy_import() return { - 'array_data': ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501 + 'array_data': ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type,), # noqa: E501 } @cached_property @@ -140,7 +140,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501 + array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -226,7 +226,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501 + array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py new file mode 100644 index 000000000000..d567ee4402e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + + +class PostInlineAdditionalPropertiesPayloadRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'array_data': ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_data': 'arrayData', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PostInlineAdditionalPropertiesPayloadRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PostInlineAdditionalPropertiesPayloadRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_data ([PostInlineAdditionalPropertiesPayloadRequestArrayDataInner], none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py new file mode 100644 index 000000000000..e8bba023a90b --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'labels': ([str, none_type],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'labels': 'labels', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + labels ([str, none_type]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + labels ([str, none_type]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index 170e786575f3..6a3e321b6a23 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -44,7 +44,6 @@ from petstore_api.model.enum_class import EnumClass from petstore_api.model.enum_test import EnumTest from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData from petstore_api.model.file import File from petstore_api.model.file_schema_test_class import FileSchemaTestClass from petstore_api.model.foo import Foo @@ -58,7 +57,6 @@ from petstore_api.model.has_only_read_only import HasOnlyReadOnly from petstore_api.model.health_check_result import HealthCheckResult from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload -from petstore_api.model.inline_object6 import InlineObject6 from petstore_api.model.inline_response_default import InlineResponseDefault from petstore_api.model.integer_enum import IntegerEnum from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue @@ -84,6 +82,8 @@ from petstore_api.model.parent_pet import ParentPet from petstore_api.model.pet import Pet from petstore_api.model.pig import Pig +from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest +from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner from petstore_api.model.quadrilateral import Quadrilateral from petstore_api.model.quadrilateral_interface import QuadrilateralInterface from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python/test/test_fake_api.py b/samples/openapi3/client/petstore/python/test/test_fake_api.py index 8782dcd4c231..cef101949bd6 100644 --- a/samples/openapi3/client/petstore/python/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/test/test_fake_api.py @@ -76,12 +76,6 @@ def test_fake_health_get(self): """ pass - def test_get_inline_additionl_properties_ref_payload(self): - """Test case for get_inline_additionl_properties_ref_payload - - """ - pass - def test_mammal(self): """Test case for mammal @@ -100,6 +94,18 @@ def test_object_model_with_ref_props(self): """ pass + def test_post_inline_additional_properties_payload(self): + """Test case for post_inline_additional_properties_payload + + """ + pass + + def test_post_inline_additional_properties_ref_payload(self): + """Test case for post_inline_additional_properties_ref_payload + + """ + pass + def test_string(self): """Test case for string @@ -172,6 +178,12 @@ def test_test_query_parameter_collection_format(self): """ pass + def test_tx_rx_any_of_model(self): + """Test case for tx_rx_any_of_model + + """ + pass + def test_upload_download_file(self): """Test case for upload_download_file diff --git a/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py new file mode 100644 index 000000000000..649f7891af22 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py @@ -0,0 +1,37 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner +globals()['PostInlineAdditionalPropertiesPayloadRequestArrayDataInner'] = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner +from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest + + +class TestPostInlineAdditionalPropertiesPayloadRequest(unittest.TestCase): + """PostInlineAdditionalPropertiesPayloadRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPostInlineAdditionalPropertiesPayloadRequest(self): + """Test PostInlineAdditionalPropertiesPayloadRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = PostInlineAdditionalPropertiesPayloadRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py new file mode 100644 index 000000000000..5a38f9ea5e57 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py @@ -0,0 +1,35 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + + +class TestPostInlineAdditionalPropertiesPayloadRequestArrayDataInner(unittest.TestCase): + """PostInlineAdditionalPropertiesPayloadRequestArrayDataInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPostInlineAdditionalPropertiesPayloadRequestArrayDataInner(self): + """Test PostInlineAdditionalPropertiesPayloadRequestArrayDataInner""" + # FIXME: construct object with mandatory attributes with example values + # model = PostInlineAdditionalPropertiesPayloadRequestArrayDataInner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py index f9ac740e4ef7..b70c91f8f809 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py @@ -644,7 +644,7 @@ def test_post_inline_additional_properties_ref_payload(self): """Test case for postInlineAdditionlPropertiesRefPayload """ from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload - from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner endpoint = self.api.post_inline_additional_properties_ref_payload_endpoint assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,) assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,) @@ -664,7 +664,7 @@ def test_post_inline_additional_properties_ref_payload(self): } inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( array_data=[ - FakePostInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo']) + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) ] ) mock_method.return_value = self.mock_response(expected_json_body) @@ -682,11 +682,11 @@ def test_post_inline_additional_properties_ref_payload(self): def test_post_inline_additional_properties_payload(self): """Test case for postInlineAdditionlPropertiesPayload """ - from petstore_api.model.inline_object6 import InlineObject6 - from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData + from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner endpoint = self.api.post_inline_additional_properties_payload_endpoint - assert endpoint.openapi_types['inline_object6'] == (InlineObject6,) - assert endpoint.settings['response_type'] == (InlineObject6,) + assert endpoint.openapi_types['post_inline_additional_properties_payload_request'] == (PostInlineAdditionalPropertiesPayloadRequest,) + assert endpoint.settings['response_type'] == (PostInlineAdditionalPropertiesPayloadRequest,) # serialization + deserialization works from petstore_api.rest import RESTClientObject, RESTResponse @@ -701,21 +701,21 @@ def test_post_inline_additional_properties_payload(self): } ] } - inline_object6 = InlineObject6( + post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( array_data=[ - FakePostInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo']) + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) ] ) mock_method.return_value = self.mock_response(expected_json_body) - response = self.api.post_inline_additional_properties_payload(inline_object6=inline_object6) + response = self.api.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) self.assert_request_called_with( mock_method, 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesPayload', body=expected_json_body ) - assert isinstance(response, InlineObject6) + assert isinstance(response, PostInlineAdditionalPropertiesPayloadRequest) assert model_to_dict(response) == expected_json_body def test_post_tx_rx_any_of_payload(self): diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES index 94616002ccfa..8073b0398951 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES @@ -15,7 +15,9 @@ models/Cat.ts models/CatAllOf.ts models/Dog.ts models/DogAllOf.ts -models/InlineObject.ts +models/InlineRequest.ts +models/InlineRequest1.ts +models/InlineRequest2.ts models/ObjectSerializer.ts models/PetByAge.ts models/PetByType.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/DefaultApi.md b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/DefaultApi.md index d0c517059050..8710d587b065 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/DefaultApi.md +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/DefaultApi.md @@ -24,8 +24,8 @@ const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); let body:.DefaultApiFilePostRequest = { - // InlineObject (optional) - inlineObject: { + // InlineRequest2 (optional) + inlineRequest2: { file: null, }, }; @@ -40,7 +40,7 @@ apiInstance.filePost(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **inlineObject** | **InlineObject**| | + **inlineRequest2** | **InlineRequest2**| | ### Return type @@ -79,8 +79,8 @@ const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); let body:.DefaultApiPetsFilteredPatchRequest = { - // PetByAge | PetByType (optional) - petByAgePetByType: null, + // InlineRequest1 (optional) + inlineRequest1: null, }; apiInstance.petsFilteredPatch(body).then((data:any) => { @@ -93,7 +93,7 @@ apiInstance.petsFilteredPatch(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petByAgePetByType** | **PetByAge | PetByType**| | + **inlineRequest1** | **InlineRequest1**| | ### Return type @@ -132,8 +132,8 @@ const configuration = .createConfiguration(); const apiInstance = new .DefaultApi(configuration); let body:.DefaultApiPetsPatchRequest = { - // Cat | Dog (optional) - catDog: null, + // InlineRequest (optional) + inlineRequest: null, }; apiInstance.petsPatch(body).then((data:any) => { @@ -146,7 +146,7 @@ apiInstance.petsPatch(body).then((data:any) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **catDog** | **Cat | Dog**| | + **inlineRequest** | **InlineRequest**| | ### Return type diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts index a2c52ae901ea..6691155af29b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts @@ -8,11 +8,9 @@ import {canConsumeForm, isCodeInRange} from '../util'; import {SecurityAuthentication} from '../auth/auth'; -import { Cat } from '../models/Cat'; -import { Dog } from '../models/Dog'; -import { InlineObject } from '../models/InlineObject'; -import { PetByAge } from '../models/PetByAge'; -import { PetByType } from '../models/PetByType'; +import { InlineRequest } from '../models/InlineRequest'; +import { InlineRequest1 } from '../models/InlineRequest1'; +import { InlineRequest2 } from '../models/InlineRequest2'; /** * no description @@ -20,9 +18,9 @@ import { PetByType } from '../models/PetByType'; export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** - * @param inlineObject + * @param inlineRequest2 */ - public async filePost(inlineObject?: InlineObject, _options?: Configuration): Promise { + public async filePost(inlineRequest2?: InlineRequest2, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -40,7 +38,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(inlineObject, "InlineObject", ""), + ObjectSerializer.serialize(inlineRequest2, "InlineRequest2", ""), contentType ); requestContext.setBody(serializedBody); @@ -55,9 +53,9 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { } /** - * @param petByAgePetByType + * @param inlineRequest1 */ - public async petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, _options?: Configuration): Promise { + public async petsFilteredPatch(inlineRequest1?: InlineRequest1, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -75,7 +73,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(petByAgePetByType, "PetByAge | PetByType", ""), + ObjectSerializer.serialize(inlineRequest1, "InlineRequest1", ""), contentType ); requestContext.setBody(serializedBody); @@ -90,9 +88,9 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { } /** - * @param catDog + * @param inlineRequest */ - public async petsPatch(catDog?: Cat | Dog, _options?: Configuration): Promise { + public async petsPatch(inlineRequest?: InlineRequest, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -110,7 +108,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(catDog, "Cat | Dog", ""), + ObjectSerializer.serialize(inlineRequest, "InlineRequest", ""), contentType ); requestContext.setBody(serializedBody); diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest.ts new file mode 100644 index 000000000000..2398826239a0 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest.ts @@ -0,0 +1,62 @@ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { Cat } from './Cat'; +import { Dog } from './Dog'; +import { HttpFile } from '../http/http'; + +export class InlineRequest { + 'hunts'?: boolean; + 'age'?: number; + 'bark'?: boolean; + 'breed'?: InlineRequestBreedEnum; + + static readonly discriminator: string | undefined = "petType"; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "hunts", + "baseName": "hunts", + "type": "boolean", + "format": "" + }, + { + "name": "age", + "baseName": "age", + "type": "number", + "format": "" + }, + { + "name": "bark", + "baseName": "bark", + "type": "boolean", + "format": "" + }, + { + "name": "breed", + "baseName": "breed", + "type": "InlineRequestBreedEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineRequest.attributeTypeMap; + } + + public constructor() { + this.petType = "InlineRequest"; + } +} + + +export type InlineRequestBreedEnum = "Dingo" | "Husky" | "Retriever" | "Shepherd" ; + diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest1.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest1.ts new file mode 100644 index 000000000000..e2dae8ad2dae --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest1.ts @@ -0,0 +1,61 @@ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PetByAge } from './PetByAge'; +import { PetByType } from './PetByType'; +import { HttpFile } from '../http/http'; + +export class InlineRequest1 { + 'age': number; + 'nickname'?: string; + 'petType': InlineRequest1PetTypeEnum; + 'hunts'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "age", + "baseName": "age", + "type": "number", + "format": "" + }, + { + "name": "nickname", + "baseName": "nickname", + "type": "string", + "format": "" + }, + { + "name": "petType", + "baseName": "pet_type", + "type": "InlineRequest1PetTypeEnum", + "format": "" + }, + { + "name": "hunts", + "baseName": "hunts", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineRequest1.attributeTypeMap; + } + + public constructor() { + } +} + + +export type InlineRequest1PetTypeEnum = "Cat" | "Dog" ; + diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest2.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest2.ts new file mode 100644 index 000000000000..62625a2852c4 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/InlineRequest2.ts @@ -0,0 +1,35 @@ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class InlineRequest2 { + 'file'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "file", + "baseName": "file", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return InlineRequest2.attributeTypeMap; + } + + public constructor() { + } +} + diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts index a05be911708c..ae022869aa34 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts @@ -2,7 +2,9 @@ export * from './Cat'; export * from './CatAllOf'; export * from './Dog'; export * from './DogAllOf'; -export * from './InlineObject'; +export * from './InlineRequest'; +export * from './InlineRequest1'; +export * from './InlineRequest2'; export * from './PetByAge'; export * from './PetByType'; @@ -10,7 +12,9 @@ import { Cat } from './Cat'; import { CatAllOf } from './CatAllOf'; import { Dog , DogBreedEnum } from './Dog'; import { DogAllOf , DogAllOfBreedEnum } from './DogAllOf'; -import { InlineObject } from './InlineObject'; +import { InlineRequest , InlineRequestBreedEnum } from './InlineRequest'; +import { InlineRequest1 , InlineRequest1PetTypeEnum } from './InlineRequest1'; +import { InlineRequest2 } from './InlineRequest2'; import { PetByAge } from './PetByAge'; import { PetByType, PetByTypePetTypeEnum } from './PetByType'; @@ -36,6 +40,8 @@ const supportedMediaTypes: { [mediaType: string]: number } = { let enumsMap: Set = new Set([ "DogBreedEnum", "DogAllOfBreedEnum", + "InlineRequestBreedEnum", + "InlineRequest1PetTypeEnum", "PetByTypePetTypeEnum", ]); @@ -44,7 +50,9 @@ let typeMap: {[index: string]: any} = { "CatAllOf": CatAllOf, "Dog": Dog, "DogAllOf": DogAllOf, - "InlineObject": InlineObject, + "InlineRequest": InlineRequest, + "InlineRequest1": InlineRequest1, + "InlineRequest2": InlineRequest2, "PetByAge": PetByAge, "PetByType": PetByType, } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/all.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/all.ts index 851c461ecf68..666d1c4b8c8e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/all.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/all.ts @@ -2,6 +2,8 @@ export * from './Cat' export * from './CatAllOf' export * from './Dog' export * from './DogAllOf' -export * from './InlineObject' +export * from './InlineRequest' +export * from './InlineRequest1' +export * from './InlineRequest2' export * from './PetByAge' export * from './PetByType' diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts index 84ebc7d8c699..04d304d385e5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts @@ -6,7 +6,9 @@ import { Cat } from '../models/Cat'; import { CatAllOf } from '../models/CatAllOf'; import { Dog } from '../models/Dog'; import { DogAllOf } from '../models/DogAllOf'; -import { InlineObject } from '../models/InlineObject'; +import { InlineRequest } from '../models/InlineRequest'; +import { InlineRequest1 } from '../models/InlineRequest1'; +import { InlineRequest2 } from '../models/InlineRequest2'; import { PetByAge } from '../models/PetByAge'; import { PetByType } from '../models/PetByType'; @@ -16,28 +18,28 @@ import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/De export interface DefaultApiFilePostRequest { /** * - * @type InlineObject + * @type InlineRequest2 * @memberof DefaultApifilePost */ - inlineObject?: InlineObject + inlineRequest2?: InlineRequest2 } export interface DefaultApiPetsFilteredPatchRequest { /** * - * @type PetByAge | PetByType + * @type InlineRequest1 * @memberof DefaultApipetsFilteredPatch */ - petByAgePetByType?: PetByAge | PetByType + inlineRequest1?: InlineRequest1 } export interface DefaultApiPetsPatchRequest { /** * - * @type Cat | Dog + * @type InlineRequest * @memberof DefaultApipetsPatch */ - catDog?: Cat | Dog + inlineRequest?: InlineRequest } export class ObjectDefaultApi { @@ -51,21 +53,21 @@ export class ObjectDefaultApi { * @param param the request object */ public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration): Promise { - return this.api.filePost(param.inlineObject, options).toPromise(); + return this.api.filePost(param.inlineRequest2, options).toPromise(); } /** * @param param the request object */ public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration): Promise { - return this.api.petsFilteredPatch(param.petByAgePetByType, options).toPromise(); + return this.api.petsFilteredPatch(param.inlineRequest1, options).toPromise(); } /** * @param param the request object */ public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration): Promise { - return this.api.petsPatch(param.catDog, options).toPromise(); + return this.api.petsPatch(param.inlineRequest, options).toPromise(); } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts index ef56e3758b8a..c6680d8f25dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts @@ -7,7 +7,9 @@ import { Cat } from '../models/Cat'; import { CatAllOf } from '../models/CatAllOf'; import { Dog } from '../models/Dog'; import { DogAllOf } from '../models/DogAllOf'; -import { InlineObject } from '../models/InlineObject'; +import { InlineRequest } from '../models/InlineRequest'; +import { InlineRequest1 } from '../models/InlineRequest1'; +import { InlineRequest2 } from '../models/InlineRequest2'; import { PetByAge } from '../models/PetByAge'; import { PetByType } from '../models/PetByType'; @@ -28,10 +30,10 @@ export class ObservableDefaultApi { } /** - * @param inlineObject + * @param inlineRequest2 */ - public filePost(inlineObject?: InlineObject, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.filePost(inlineObject, _options); + public filePost(inlineRequest2?: InlineRequest2, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.filePost(inlineRequest2, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); @@ -50,10 +52,10 @@ export class ObservableDefaultApi { } /** - * @param petByAgePetByType + * @param inlineRequest1 */ - public petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.petsFilteredPatch(petByAgePetByType, _options); + public petsFilteredPatch(inlineRequest1?: InlineRequest1, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.petsFilteredPatch(inlineRequest1, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); @@ -72,10 +74,10 @@ export class ObservableDefaultApi { } /** - * @param catDog + * @param inlineRequest */ - public petsPatch(catDog?: Cat | Dog, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.petsPatch(catDog, _options); + public petsPatch(inlineRequest?: InlineRequest, _options?: Configuration): Observable { + const requestContextPromise = this.requestFactory.petsPatch(inlineRequest, _options); // build promise chain let middlewarePreObservable = from(requestContextPromise); diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts index 4939db8127b3..046970370a89 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts @@ -6,7 +6,9 @@ import { Cat } from '../models/Cat'; import { CatAllOf } from '../models/CatAllOf'; import { Dog } from '../models/Dog'; import { DogAllOf } from '../models/DogAllOf'; -import { InlineObject } from '../models/InlineObject'; +import { InlineRequest } from '../models/InlineRequest'; +import { InlineRequest1 } from '../models/InlineRequest1'; +import { InlineRequest2 } from '../models/InlineRequest2'; import { PetByAge } from '../models/PetByAge'; import { PetByType } from '../models/PetByType'; import { ObservableDefaultApi } from './ObservableAPI'; @@ -24,26 +26,26 @@ export class PromiseDefaultApi { } /** - * @param inlineObject + * @param inlineRequest2 */ - public filePost(inlineObject?: InlineObject, _options?: Configuration): Promise { - const result = this.api.filePost(inlineObject, _options); + public filePost(inlineRequest2?: InlineRequest2, _options?: Configuration): Promise { + const result = this.api.filePost(inlineRequest2, _options); return result.toPromise(); } /** - * @param petByAgePetByType + * @param inlineRequest1 */ - public petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, _options?: Configuration): Promise { - const result = this.api.petsFilteredPatch(petByAgePetByType, _options); + public petsFilteredPatch(inlineRequest1?: InlineRequest1, _options?: Configuration): Promise { + const result = this.api.petsFilteredPatch(inlineRequest1, _options); return result.toPromise(); } /** - * @param catDog + * @param inlineRequest */ - public petsPatch(catDog?: Cat | Dog, _options?: Configuration): Promise { - const result = this.api.petsPatch(catDog, _options); + public petsPatch(inlineRequest?: InlineRequest, _options?: Configuration): Promise { + const result = this.api.petsPatch(inlineRequest, _options); return result.toPromise(); } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml index 1438a89f5cc3..b629acd9d7f6 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml @@ -252,18 +252,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -293,19 +285,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -686,16 +669,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -870,7 +843,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -879,7 +852,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml index 1438a89f5cc3..b629acd9d7f6 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml @@ -252,18 +252,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -293,19 +285,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -686,16 +669,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -870,7 +843,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -879,7 +852,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml index 1438a89f5cc3..b629acd9d7f6 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml @@ -252,18 +252,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -293,19 +285,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -686,16 +669,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -870,7 +843,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -879,7 +852,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 6798a9a98bf8..323c86f18290 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -293,16 +293,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -337,17 +328,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -987,6 +968,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json index 6798a9a98bf8..323c86f18290 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -293,16 +293,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -337,17 +328,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -987,6 +968,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index d9963cb894de..86077d64b024 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -301,21 +301,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object", "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -349,22 +338,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object_1", "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -825,24 +802,6 @@ }, "description" : "Pet object that needs to be added to the store", "required" : true - }, - "inline_object" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object" - } - } - } - }, - "inline_object_1" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object_1" - } - } - } } }, "schemas" : { @@ -1066,7 +1025,7 @@ "title" : "An uploaded response", "type" : "object" }, - "inline_object" : { + "updatePetWithForm_request" : { "properties" : { "name" : { "description" : "Updated name of the pet", @@ -1079,7 +1038,7 @@ }, "type" : "object" }, - "inline_object_1" : { + "uploadFile_request" : { "properties" : { "additionalMetadata" : { "description" : "Additional data to pass to server", diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index d9963cb894de..86077d64b024 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -301,21 +301,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object", "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -349,22 +338,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object_1", "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -825,24 +802,6 @@ }, "description" : "Pet object that needs to be added to the store", "required" : true - }, - "inline_object" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object" - } - } - } - }, - "inline_object_1" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object_1" - } - } - } } }, "schemas" : { @@ -1066,7 +1025,7 @@ "title" : "An uploaded response", "type" : "object" }, - "inline_object" : { + "updatePetWithForm_request" : { "properties" : { "name" : { "description" : "Updated name of the pet", @@ -1079,7 +1038,7 @@ }, "type" : "object" }, - "inline_object_1" : { + "uploadFile_request" : { "properties" : { "additionalMetadata" : { "description" : "Additional data to pass to server", diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json index 6798a9a98bf8..323c86f18290 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -293,16 +293,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -337,17 +328,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -987,6 +968,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/erlang-server/priv/openapi.json b/samples/server/petstore/erlang-server/priv/openapi.json index d9963cb894de..86077d64b024 100644 --- a/samples/server/petstore/erlang-server/priv/openapi.json +++ b/samples/server/petstore/erlang-server/priv/openapi.json @@ -301,21 +301,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object", "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -349,22 +338,10 @@ "style" : "simple" } ], "requestBody" : { - "$ref" : "#/components/requestBodies/inline_object_1", "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - }, - "type" : "object" + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -825,24 +802,6 @@ }, "description" : "Pet object that needs to be added to the store", "required" : true - }, - "inline_object" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object" - } - } - } - }, - "inline_object_1" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "$ref" : "#/components/schemas/inline_object_1" - } - } - } } }, "schemas" : { @@ -1066,7 +1025,7 @@ "title" : "An uploaded response", "type" : "object" }, - "inline_object" : { + "updatePetWithForm_request" : { "properties" : { "name" : { "description" : "Updated name of the pet", @@ -1079,7 +1038,7 @@ }, "type" : "object" }, - "inline_object_1" : { + "uploadFile_request" : { "properties" : { "additionalMetadata" : { "description" : "Additional data to pass to server", diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index da52949d044b..f96f3d8027a0 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -801,7 +774,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -810,7 +783,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/go-chi-server/api/openapi.yaml b/samples/server/petstore/go-chi-server/api/openapi.yaml index da52949d044b..f96f3d8027a0 100644 --- a/samples/server/petstore/go-chi-server/api/openapi.yaml +++ b/samples/server/petstore/go-chi-server/api/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -801,7 +774,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -810,7 +783,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml index da52949d044b..f96f3d8027a0 100644 --- a/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml +++ b/samples/server/petstore/go-echo-server/.docs/api/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -801,7 +774,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -810,7 +783,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/server/petstore/go-gin-api-server/api/openapi.yaml index da52949d044b..f96f3d8027a0 100644 --- a/samples/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-gin-api-server/api/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -801,7 +774,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -810,7 +783,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/go-server-required/api/openapi.yaml b/samples/server/petstore/go-server-required/api/openapi.yaml index 47383ea1bedc..e807fe206af5 100644 --- a/samples/server/petstore/go-server-required/api/openapi.yaml +++ b/samples/server/petstore/go-server-required/api/openapi.yaml @@ -231,18 +231,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -268,19 +260,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -616,16 +599,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: OrderInfo: description: An order info for a pets from the pet store @@ -997,7 +970,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -1006,7 +979,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json +++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-async/public/openapi.json +++ b/samples/server/petstore/java-play-framework-async/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index c25c28ce9bd1..f1f6720be962 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -316,16 +316,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -362,17 +353,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -983,23 +964,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "enum_form_string_array" : { - "description" : "Form parameter enum test (string array)", - "items" : { - "default" : "$", - "enum" : [ ">", "$" ], - "type" : "string" - }, - "type" : "array" - }, - "enum_form_string" : { - "default" : "-efg", - "description" : "Form parameter enum test (string)", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "type" : "string" - } - } + "$ref" : "#/components/schemas/testEnumParameters_request" } } } @@ -1058,88 +1023,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "integer" : { - "description" : "None", - "format" : "int32", - "maximum" : 100, - "minimum" : 10, - "type" : "integer" - }, - "int32" : { - "description" : "None", - "format" : "int32", - "maximum" : 200, - "minimum" : 20, - "type" : "integer" - }, - "int64" : { - "description" : "None", - "format" : "int64", - "type" : "integer" - }, - "number" : { - "description" : "None", - "maximum" : 543.2, - "minimum" : 32.1, - "type" : "number" - }, - "float" : { - "description" : "None", - "format" : "float", - "maximum" : 987.6, - "type" : "number" - }, - "double" : { - "description" : "None", - "format" : "double", - "maximum" : 123.4, - "minimum" : 67.8, - "type" : "number" - }, - "string" : { - "description" : "None", - "pattern" : "/[a-z]/i", - "type" : "string" - }, - "pattern_without_delimiter" : { - "description" : "None", - "pattern" : "^[A-Z].*", - "type" : "string" - }, - "byte" : { - "description" : "None", - "format" : "byte", - "type" : "string" - }, - "binary" : { - "description" : "None", - "format" : "binary", - "type" : "string" - }, - "date" : { - "description" : "None", - "format" : "date", - "type" : "string" - }, - "dateTime" : { - "description" : "None", - "format" : "date-time", - "type" : "string" - }, - "password" : { - "description" : "None", - "format" : "password", - "maxLength" : 64, - "minLength" : 10, - "type" : "string" - }, - "callback" : { - "description" : "None", - "type" : "string" - } - }, - "required" : [ "byte", "double", "number", "pattern_without_delimiter" ] + "$ref" : "#/components/schemas/testEndpointParameters_request" } } }, @@ -1303,17 +1187,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "param" : { - "description" : "field1", - "type" : "string" - }, - "param2" : { - "description" : "field2", - "type" : "string" - } - }, - "required" : [ "param", "param2" ] + "$ref" : "#/components/schemas/testJsonFormData_request" } } }, @@ -1596,18 +1470,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "requiredFile" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - }, - "required" : [ "requiredFile" ] + "$ref" : "#/components/schemas/uploadFileWithRequiredFile_request" } } }, @@ -2826,6 +2689,161 @@ "prefix" : "pre" } }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } + }, + "testEnumParameters_request" : { + "properties" : { + "enum_form_string_array" : { + "description" : "Form parameter enum test (string array)", + "items" : { + "default" : "$", + "enum" : [ ">", "$" ], + "type" : "string" + }, + "type" : "array" + }, + "enum_form_string" : { + "default" : "-efg", + "description" : "Form parameter enum test (string)", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "type" : "string" + } + } + }, + "testEndpointParameters_request" : { + "properties" : { + "integer" : { + "description" : "None", + "format" : "int32", + "maximum" : 100, + "minimum" : 10, + "type" : "integer" + }, + "int32" : { + "description" : "None", + "format" : "int32", + "maximum" : 200, + "minimum" : 20, + "type" : "integer" + }, + "int64" : { + "description" : "None", + "format" : "int64", + "type" : "integer" + }, + "number" : { + "description" : "None", + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number" + }, + "float" : { + "description" : "None", + "format" : "float", + "maximum" : 987.6, + "type" : "number" + }, + "double" : { + "description" : "None", + "format" : "double", + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number" + }, + "string" : { + "description" : "None", + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "pattern_without_delimiter" : { + "description" : "None", + "pattern" : "^[A-Z].*", + "type" : "string" + }, + "byte" : { + "description" : "None", + "format" : "byte", + "type" : "string" + }, + "binary" : { + "description" : "None", + "format" : "binary", + "type" : "string" + }, + "date" : { + "description" : "None", + "format" : "date", + "type" : "string" + }, + "dateTime" : { + "description" : "None", + "format" : "date-time", + "type" : "string" + }, + "password" : { + "description" : "None", + "format" : "password", + "maxLength" : 64, + "minLength" : 10, + "type" : "string" + }, + "callback" : { + "description" : "None", + "type" : "string" + } + }, + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ] + }, + "testJsonFormData_request" : { + "properties" : { + "param" : { + "description" : "field1", + "type" : "string" + }, + "param2" : { + "description" : "field2", + "type" : "string" + } + }, + "required" : [ "param", "param2" ] + }, + "uploadFileWithRequiredFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "requiredFile" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + }, + "required" : [ "requiredFile" ] + }, "Dog_allOf" : { "properties" : { "breed" : { diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json b/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-play-framework/public/openapi.json +++ b/samples/server/petstore/java-play-framework/public/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json index 70d76adacd9e..8c3a37f88951 100644 --- a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json +++ b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json @@ -301,16 +301,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } + "$ref" : "#/components/schemas/updatePetWithForm_request" } } } @@ -347,17 +338,7 @@ "content" : { "multipart/form-data" : { "schema" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } + "$ref" : "#/components/schemas/uploadFile_request" } } } @@ -1016,6 +997,31 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "updatePetWithForm_request" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + } + }, + "uploadFile_request" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml index 625a038dc381..206abd76cbf8 100644 --- a/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml +++ b/samples/server/petstore/java-vertx-web/src/main/resources/openapi.yaml @@ -240,18 +240,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -279,19 +271,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -646,16 +629,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -830,7 +803,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -839,7 +812,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server 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 d4ba592c4f24..bf1a42764177 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 @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: 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 d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-delegate/src/main/resources/openapi.yaml index da52949d044b..f96f3d8027a0 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/resources/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -801,7 +774,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -810,7 +783,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml index 847cd9d27677..cd8953c54d0a 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml @@ -229,13 +229,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -262,14 +256,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -747,6 +734,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml index 847cd9d27677..cd8953c54d0a 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml @@ -229,13 +229,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -262,14 +256,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -747,6 +734,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml index 847cd9d27677..cd8953c54d0a 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml @@ -229,13 +229,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -262,14 +256,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -747,6 +734,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml index 847cd9d27677..cd8953c54d0a 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml @@ -229,13 +229,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -262,14 +256,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -747,6 +734,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml index 847cd9d27677..cd8953c54d0a 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml @@ -229,13 +229,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -262,14 +256,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -747,6 +734,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml index c8de6c51df21..4b0bc4d300f7 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml @@ -237,13 +237,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' x-body-name: body responses: "405": @@ -273,14 +267,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' x-body-name: body responses: "200": @@ -804,6 +791,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml index c8de6c51df21..4b0bc4d300f7 100644 --- a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml @@ -237,13 +237,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' x-body-name: body responses: "405": @@ -273,14 +267,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' x-body-name: body responses: "200": @@ -804,6 +791,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-fastapi/openapi.yaml b/samples/server/petstore/python-fastapi/openapi.yaml index b1525d6e7f37..49ab56baa7e0 100644 --- a/samples/server/petstore/python-fastapi/openapi.yaml +++ b/samples/server/petstore/python-fastapi/openapi.yaml @@ -232,18 +232,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": description: Invalid input @@ -269,19 +261,10 @@ paths: type: integer style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -617,16 +600,6 @@ components: $ref: '#/components/schemas/Pet' description: Pet object that needs to be added to the store required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -827,7 +800,7 @@ components: type: string title: An uploaded response type: object - inline_object: + updatePetWithForm_request: properties: name: description: Updated name of the pet @@ -836,7 +809,7 @@ components: description: Updated status of the pet type: string type: object - inline_object_1: + uploadFile_request: properties: additionalMetadata: description: Additional data to pass to server diff --git a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index 4c6a1f228c01..88f24d6be5cf 100644 --- a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -235,13 +235,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -269,14 +263,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -793,6 +780,23 @@ components: type: string title: An uploaded response type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES index e88627ad81f4..9e5863008715 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES @@ -3,7 +3,7 @@ Cargo.toml README.md api/openapi.yaml -docs/InlineObject.md +docs/InlineRequest.md docs/MultipartRelatedRequest.md docs/MultipartRequestObjectField.md docs/default_api.md diff --git a/samples/server/petstore/rust-server/output/multipart-v3/README.md b/samples/server/petstore/rust-server/output/multipart-v3/README.md index 1ad0dea45f31..30bce4297f03 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/README.md +++ b/samples/server/petstore/rust-server/output/multipart-v3/README.md @@ -104,7 +104,7 @@ Method | HTTP request | Description ## Documentation For Models - - [InlineObject](docs/InlineObject.md) + - [InlineRequest](docs/InlineRequest.md) - [MultipartRelatedRequest](docs/MultipartRelatedRequest.md) - [MultipartRequestObjectField](docs/MultipartRequestObjectField.md) diff --git a/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml index a1a58c5e69c4..860da7ea3a3f 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml @@ -53,7 +53,6 @@ paths: /multiple-identical-mime-types: post: requestBody: - $ref: '#/components/requestBodies/inline_object' content: multipart/related: encoding: @@ -64,26 +63,12 @@ paths: contentType: application/octet-stream style: form schema: - properties: - binary1: - format: binary - type: string - binary2: - format: binary - type: string - type: object + $ref: '#/components/schemas/inline_request' required: true responses: "200": description: OK components: - requestBodies: - inline_object: - content: - multipart/related: - schema: - $ref: '#/components/schemas/inline_object' - required: true schemas: multipart_request: properties: @@ -113,7 +98,7 @@ components: required: - required_binary_field type: object - inline_object: + inline_request: properties: binary1: format: binary diff --git a/samples/server/petstore/rust-server/output/multipart-v3/docs/InlineRequest.md b/samples/server/petstore/rust-server/output/multipart-v3/docs/InlineRequest.md new file mode 100644 index 000000000000..36896e0eec68 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/docs/InlineRequest.md @@ -0,0 +1,11 @@ +# InlineRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**binary1** | [***swagger::ByteArray**](file.md) | | [optional] [default to None] +**binary2** | [***swagger::ByteArray**](file.md) | | [optional] [default to None] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs index d201b0407f23..6f7d94516fd3 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs @@ -6,7 +6,7 @@ use crate::header; #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] -pub struct InlineObject { +pub struct InlineRequest { #[serde(rename = "binary1")] #[serde(skip_serializing_if="Option::is_none")] pub binary1: Option, @@ -17,19 +17,19 @@ pub struct InlineObject { } -impl InlineObject { - pub fn new() -> InlineObject { - InlineObject { +impl InlineRequest { + pub fn new() -> InlineRequest { + InlineRequest { binary1: None, binary2: None, } } } -/// Converts the InlineObject value to the Query Parameters representation (style=form, explode=false) +/// Converts the InlineRequest value to the Query Parameters representation (style=form, explode=false) /// specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde serializer -impl std::string::ToString for InlineObject { +impl std::string::ToString for InlineRequest { fn to_string(&self) -> String { let mut params: Vec = vec![]; // Skipping binary1 in query parameter serialization @@ -42,10 +42,10 @@ impl std::string::ToString for InlineObject { } } -/// Converts Query Parameters representation (style=form, explode=false) to a InlineObject value +/// Converts Query Parameters representation (style=form, explode=false) to a InlineRequest value /// as specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde deserializer -impl std::str::FromStr for InlineObject { +impl std::str::FromStr for InlineRequest { type Err = String; fn from_str(s: &str) -> std::result::Result { @@ -65,14 +65,14 @@ impl std::str::FromStr for InlineObject { while key_result.is_some() { let val = match string_iter.next() { Some(x) => x, - None => return std::result::Result::Err("Missing value while parsing InlineObject".to_string()) + None => return std::result::Result::Err("Missing value while parsing InlineRequest".to_string()) }; if let Some(key) = key_result { match key { - "binary1" => return std::result::Result::Err("Parsing binary data in this style is not supported in InlineObject".to_string()), - "binary2" => return std::result::Result::Err("Parsing binary data in this style is not supported in InlineObject".to_string()), - _ => return std::result::Result::Err("Unexpected key while parsing InlineObject".to_string()) + "binary1" => return std::result::Result::Err("Parsing binary data in this style is not supported in InlineRequest".to_string()), + "binary2" => return std::result::Result::Err("Parsing binary data in this style is not supported in InlineRequest".to_string()), + _ => return std::result::Result::Err("Unexpected key while parsing InlineRequest".to_string()) } } @@ -81,41 +81,41 @@ impl std::str::FromStr for InlineObject { } // Use the intermediate representation to return the struct - std::result::Result::Ok(InlineObject { + std::result::Result::Ok(InlineRequest { binary1: intermediate_rep.binary1.into_iter().next(), binary2: intermediate_rep.binary2.into_iter().next(), }) } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", + format!("Invalid header value for InlineRequest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", + format!("Unable to convert header value '{}' into InlineRequest - {}", value, err)) } }, diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES index 2334dbd17046..cfc118d4ff78 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES @@ -3,7 +3,7 @@ Cargo.toml README.md api/openapi.yaml -docs/InlineObject.md +docs/InlineRequest.md docs/default_api.md examples/ca.pem examples/client/main.rs diff --git a/samples/server/petstore/rust-server/output/no-example-v3/README.md b/samples/server/petstore/rust-server/output/no-example-v3/README.md index 707a2a482851..8bee672329a2 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/README.md +++ b/samples/server/petstore/rust-server/output/no-example-v3/README.md @@ -99,7 +99,7 @@ Method | HTTP request | Description ## Documentation For Models - - [InlineObject](docs/InlineObject.md) + - [InlineRequest](docs/InlineRequest.md) ## Documentation For Authorization diff --git a/samples/server/petstore/rust-server/output/no-example-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/no-example-v3/api/openapi.yaml index 0e9e1377ea91..f63e831ad43b 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/no-example-v3/api/openapi.yaml @@ -8,30 +8,17 @@ paths: /op: get: requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/json: schema: - properties: - propery: - type: string - required: - - property - type: object + $ref: '#/components/schemas/inline_request' required: true responses: "200": description: OK components: - requestBodies: - inline_object: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_object' - required: true schemas: - inline_object: + inline_request: properties: propery: type: string diff --git a/samples/server/petstore/rust-server/output/no-example-v3/docs/InlineRequest.md b/samples/server/petstore/rust-server/output/no-example-v3/docs/InlineRequest.md new file mode 100644 index 000000000000..1b792f66d8de --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/docs/InlineRequest.md @@ -0,0 +1,10 @@ +# InlineRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propery** | **String** | | [optional] [default to None] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/no-example-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/no-example-v3/docs/default_api.md index bc74179b4465..03deff06924f 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/no-example-v3/docs/default_api.md @@ -8,14 +8,14 @@ Method | HTTP request | Description # **** -> (inline_object) +> (inline_request) ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **inline_object** | [**InlineObject**](InlineObject.md)| | + **inline_request** | [**InlineRequest**](InlineRequest.md)| | ### Return type diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs index bce4430a41cf..46d195faf93d 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs @@ -104,11 +104,11 @@ impl Api for Server where C: Has + Send + Sync { async fn op_get( &self, - inline_object: models::InlineObject, + inline_request: models::InlineRequest, context: &C) -> Result { let context = context.clone(); - info!("op_get({:?}) - X-Span-ID: {:?}", inline_object, context.get().0.clone()); + info!("op_get({:?}) - X-Span-ID: {:?}", inline_request, context.get().0.clone()); Err(ApiError("Generic failure".into())) } diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/client/mod.rs index b6aa0d0c5f64..5941e759d64f 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/client/mod.rs @@ -382,7 +382,7 @@ impl Api for Client where async fn op_get( &self, - param_inline_object: models::InlineObject, + param_inline_request: models::InlineRequest, context: &C) -> Result { let mut client_service = self.client_service.clone(); @@ -415,7 +415,7 @@ impl Api for Client where }; // Body parameter - let body = serde_json::to_string(¶m_inline_object).expect("impossible to fail to serialize"); + let body = serde_json::to_string(¶m_inline_request).expect("impossible to fail to serialize"); *request.body_mut() = Body::from(body); diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs index c4dcf99042b1..0b81f725817d 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs @@ -27,7 +27,7 @@ pub trait Api { async fn op_get( &self, - inline_object: models::InlineObject, + inline_request: models::InlineRequest, context: &C) -> Result; } @@ -42,7 +42,7 @@ pub trait ApiNoContext { async fn op_get( &self, - inline_object: models::InlineObject, + inline_request: models::InlineRequest, ) -> Result; } @@ -72,11 +72,11 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex async fn op_get( &self, - inline_object: models::InlineObject, + inline_request: models::InlineRequest, ) -> Result { let context = self.context().clone(); - self.api().op_get(inline_object, &context).await + self.api().op_get(inline_request, &context).await } } diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs index 0175af64b567..ad99e5097c4e 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs @@ -6,25 +6,25 @@ use crate::header; #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] -pub struct InlineObject { +pub struct InlineRequest { #[serde(rename = "propery")] #[serde(skip_serializing_if="Option::is_none")] pub propery: Option, } -impl InlineObject { - pub fn new() -> InlineObject { - InlineObject { +impl InlineRequest { + pub fn new() -> InlineRequest { + InlineRequest { propery: None, } } } -/// Converts the InlineObject value to the Query Parameters representation (style=form, explode=false) +/// Converts the InlineRequest value to the Query Parameters representation (style=form, explode=false) /// specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde serializer -impl std::string::ToString for InlineObject { +impl std::string::ToString for InlineRequest { fn to_string(&self) -> String { let mut params: Vec = vec![]; @@ -37,10 +37,10 @@ impl std::string::ToString for InlineObject { } } -/// Converts Query Parameters representation (style=form, explode=false) to a InlineObject value +/// Converts Query Parameters representation (style=form, explode=false) to a InlineRequest value /// as specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde deserializer -impl std::str::FromStr for InlineObject { +impl std::str::FromStr for InlineRequest { type Err = String; fn from_str(s: &str) -> std::result::Result { @@ -59,13 +59,13 @@ impl std::str::FromStr for InlineObject { while key_result.is_some() { let val = match string_iter.next() { Some(x) => x, - None => return std::result::Result::Err("Missing value while parsing InlineObject".to_string()) + None => return std::result::Result::Err("Missing value while parsing InlineRequest".to_string()) }; if let Some(key) = key_result { match key { "propery" => intermediate_rep.propery.push(::from_str(val).map_err(|x| format!("{}", x))?), - _ => return std::result::Result::Err("Unexpected key while parsing InlineObject".to_string()) + _ => return std::result::Result::Err("Unexpected key while parsing InlineRequest".to_string()) } } @@ -74,40 +74,40 @@ impl std::str::FromStr for InlineObject { } // Use the intermediate representation to return the struct - std::result::Result::Ok(InlineObject { + std::result::Result::Ok(InlineRequest { propery: intermediate_rep.propery.into_iter().next(), }) } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", + format!("Invalid header value for InlineRequest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", + format!("Unable to convert header value '{}' into InlineRequest - {}", value, err)) } }, diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs index 3f48eab84c68..caa67c058c37 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs @@ -148,31 +148,31 @@ impl hyper::service::Service<(Request, C)> for Service where match result { Ok(body) => { let mut unused_elements = Vec::new(); - let param_inline_object: Option = if !body.is_empty() { + let param_inline_request: Option = if !body.is_empty() { let deserializer = &mut serde_json::Deserializer::from_slice(&*body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { - Ok(param_inline_object) => param_inline_object, + Ok(param_inline_request) => param_inline_request, Err(e) => return Ok(Response::builder() .status(StatusCode::BAD_REQUEST) - .body(Body::from(format!("Couldn't parse body parameter InlineObject - doesn't match schema: {}", e))) - .expect("Unable to create Bad Request response for invalid body parameter InlineObject due to schema")), + .body(Body::from(format!("Couldn't parse body parameter InlineRequest - doesn't match schema: {}", e))) + .expect("Unable to create Bad Request response for invalid body parameter InlineRequest due to schema")), } } else { None }; - let param_inline_object = match param_inline_object { - Some(param_inline_object) => param_inline_object, + let param_inline_request = match param_inline_request { + Some(param_inline_request) => param_inline_request, None => return Ok(Response::builder() .status(StatusCode::BAD_REQUEST) - .body(Body::from("Missing required body parameter InlineObject")) - .expect("Unable to create Bad Request response for missing body parameter InlineObject")), + .body(Body::from("Missing required body parameter InlineRequest")) + .expect("Unable to create Bad Request response for missing body parameter InlineRequest")), }; let result = api_impl.op_get( - param_inline_object, + param_inline_request, &context ).await; let mut response = Response::new(Body::empty()); @@ -207,8 +207,8 @@ impl hyper::service::Service<(Request, C)> for Service where }, Err(e) => Ok(Response::builder() .status(StatusCode::BAD_REQUEST) - .body(Body::from(format!("Couldn't read body parameter InlineObject: {}", e))) - .expect("Unable to create Bad Request response due to unable to read body parameter InlineObject")), + .body(Body::from(format!("Couldn't read body parameter InlineRequest: {}", e))) + .expect("Unable to create Bad Request response due to unable to read body parameter InlineRequest")), } }, 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 8fd01614a253..96301e90a405 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 @@ -230,13 +230,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -263,14 +257,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -672,15 +659,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -723,77 +702,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -902,16 +811,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1561,6 +1461,116 @@ components: OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 Dog_allOf: properties: breed: diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES index 1495d4416fbc..ebf62ae2756c 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES @@ -7,8 +7,8 @@ docs/ANullableContainer.md docs/AdditionalPropertiesObject.md docs/AllOfObject.md docs/BaseAllOf.md +docs/DummyPutRequest.md docs/GetYamlResponse.md -docs/InlineObject.md docs/ObjectOfObjects.md docs/ObjectOfObjectsInner.md docs/default_api.md diff --git a/samples/server/petstore/rust-server/output/rust-server-test/README.md b/samples/server/petstore/rust-server/output/rust-server-test/README.md index 13d136522ec5..37f1e45493af 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/README.md +++ b/samples/server/petstore/rust-server/output/rust-server-test/README.md @@ -118,8 +118,8 @@ Method | HTTP request | Description - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - [AllOfObject](docs/AllOfObject.md) - [BaseAllOf](docs/BaseAllOf.md) + - [DummyPutRequest](docs/DummyPutRequest.md) - [GetYamlResponse](docs/GetYamlResponse.md) - - [InlineObject](docs/InlineObject.md) - [ObjectOfObjects](docs/ObjectOfObjects.md) - [ObjectOfObjectsInner](docs/ObjectOfObjectsInner.md) 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 e7cef9a3cf2a..81e4b4dc2329 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 @@ -17,18 +17,10 @@ paths: put: operationId: dummyPut requestBody: - $ref: '#/components/requestBodies/inline_object' content: '*/*': schema: - properties: - id: - type: string - password: - type: string - required: - - id - type: object + $ref: '#/components/schemas/dummyPut_request' required: true responses: "200": @@ -144,12 +136,6 @@ components: - id type: object required: true - inline_object: - content: - '*/*': - schema: - $ref: '#/components/schemas/inline_object' - required: true schemas: additionalPropertiesObject: additionalProperties: @@ -194,7 +180,7 @@ components: description: Inner string type: string type: object - inline_object: + dummyPut_request: properties: id: type: string diff --git a/samples/server/petstore/rust-server/output/rust-server-test/docs/DummyPutRequest.md b/samples/server/petstore/rust-server/output/rust-server-test/docs/DummyPutRequest.md new file mode 100644 index 000000000000..7e9214c43659 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/docs/DummyPutRequest.md @@ -0,0 +1,11 @@ +# DummyPutRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**password** | **String** | | [optional] [default to None] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/rust-server-test/docs/default_api.md b/samples/server/petstore/rust-server/output/rust-server-test/docs/default_api.md index 765136251f6c..72af23483491 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/rust-server-test/docs/default_api.md @@ -69,7 +69,7 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **nested_response** | [**InlineObject**](InlineObject.md)| | + **nested_response** | [**DummyPutRequest**](DummyPutRequest.md)| | ### Return type diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs index 5fcce139cb77..143e17a051d0 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs @@ -131,7 +131,7 @@ impl Api for Server where C: Has + Send + Sync async fn dummy_put( &self, - nested_response: models::InlineObject, + nested_response: models::DummyPutRequest, context: &C) -> Result { let context = context.clone(); diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs index 3cb82b64ab11..623ea11d1821 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs @@ -536,7 +536,7 @@ impl Api for Client where async fn dummy_put( &self, - param_nested_response: models::InlineObject, + param_nested_response: models::DummyPutRequest, context: &C) -> Result { let mut client_service = self.client_service.clone(); diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index 0d7e47499bd9..26fd27856470 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -89,7 +89,7 @@ pub trait Api { async fn dummy_put( &self, - nested_response: models::InlineObject, + nested_response: models::DummyPutRequest, context: &C) -> Result; /// Get a file @@ -144,7 +144,7 @@ pub trait ApiNoContext { async fn dummy_put( &self, - nested_response: models::InlineObject, + nested_response: models::DummyPutRequest, ) -> Result; /// Get a file @@ -222,7 +222,7 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex async fn dummy_put( &self, - nested_response: models::InlineObject, + nested_response: models::DummyPutRequest, ) -> Result { let context = self.context().clone(); diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs index 5bb9c13acba1..381b7632a6a0 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -427,52 +427,59 @@ impl std::convert::TryFrom for header::IntoHeaderVal } -/// structured response #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] -pub struct GetYamlResponse { - /// Inner string - #[serde(rename = "value")] +pub struct DummyPutRequest { + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "password")] #[serde(skip_serializing_if="Option::is_none")] - pub value: Option, + pub password: Option, } -impl GetYamlResponse { - pub fn new() -> GetYamlResponse { - GetYamlResponse { - value: None, +impl DummyPutRequest { + pub fn new(id: String, ) -> DummyPutRequest { + DummyPutRequest { + id: id, + password: None, } } } -/// Converts the GetYamlResponse value to the Query Parameters representation (style=form, explode=false) +/// Converts the DummyPutRequest value to the Query Parameters representation (style=form, explode=false) /// specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde serializer -impl std::string::ToString for GetYamlResponse { +impl std::string::ToString for DummyPutRequest { fn to_string(&self) -> String { let mut params: Vec = vec![]; - if let Some(ref value) = self.value { - params.push("value".to_string()); - params.push(value.to_string()); + params.push("id".to_string()); + params.push(self.id.to_string()); + + + if let Some(ref password) = self.password { + params.push("password".to_string()); + params.push(password.to_string()); } params.join(",").to_string() } } -/// Converts Query Parameters representation (style=form, explode=false) to a GetYamlResponse value +/// Converts Query Parameters representation (style=form, explode=false) to a DummyPutRequest value /// as specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde deserializer -impl std::str::FromStr for GetYamlResponse { +impl std::str::FromStr for DummyPutRequest { type Err = String; fn from_str(s: &str) -> std::result::Result { #[derive(Default)] // An intermediate representation of the struct to use for parsing. struct IntermediateRep { - pub value: Vec, + pub id: Vec, + pub password: Vec, } let mut intermediate_rep = IntermediateRep::default(); @@ -484,13 +491,14 @@ impl std::str::FromStr for GetYamlResponse { while key_result.is_some() { let val = match string_iter.next() { Some(x) => x, - None => return std::result::Result::Err("Missing value while parsing GetYamlResponse".to_string()) + None => return std::result::Result::Err("Missing value while parsing DummyPutRequest".to_string()) }; if let Some(key) = key_result { match key { - "value" => intermediate_rep.value.push(::from_str(val).map_err(|x| format!("{}", x))?), - _ => return std::result::Result::Err("Unexpected key while parsing GetYamlResponse".to_string()) + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| format!("{}", x))?), + _ => return std::result::Result::Err("Unexpected key while parsing DummyPutRequest".to_string()) } } @@ -499,40 +507,41 @@ impl std::str::FromStr for GetYamlResponse { } // Use the intermediate representation to return the struct - std::result::Result::Ok(GetYamlResponse { - value: intermediate_rep.value.into_iter().next(), + std::result::Result::Ok(DummyPutRequest { + id: intermediate_rep.id.into_iter().next().ok_or("id missing in DummyPutRequest".to_string())?, + password: intermediate_rep.password.into_iter().next(), }) } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for GetYamlResponse - value: {} is invalid {}", + format!("Invalid header value for DummyPutRequest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into GetYamlResponse - {}", + format!("Unable to convert header value '{}' into DummyPutRequest - {}", value, err)) } }, @@ -544,59 +553,52 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +/// structured response #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] -pub struct InlineObject { - #[serde(rename = "id")] - pub id: String, - - #[serde(rename = "password")] +pub struct GetYamlResponse { + /// Inner string + #[serde(rename = "value")] #[serde(skip_serializing_if="Option::is_none")] - pub password: Option, + pub value: Option, } -impl InlineObject { - pub fn new(id: String, ) -> InlineObject { - InlineObject { - id: id, - password: None, +impl GetYamlResponse { + pub fn new() -> GetYamlResponse { + GetYamlResponse { + value: None, } } } -/// Converts the InlineObject value to the Query Parameters representation (style=form, explode=false) +/// Converts the GetYamlResponse value to the Query Parameters representation (style=form, explode=false) /// specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde serializer -impl std::string::ToString for InlineObject { +impl std::string::ToString for GetYamlResponse { fn to_string(&self) -> String { let mut params: Vec = vec![]; - params.push("id".to_string()); - params.push(self.id.to_string()); - - - if let Some(ref password) = self.password { - params.push("password".to_string()); - params.push(password.to_string()); + if let Some(ref value) = self.value { + params.push("value".to_string()); + params.push(value.to_string()); } params.join(",").to_string() } } -/// Converts Query Parameters representation (style=form, explode=false) to a InlineObject value +/// Converts Query Parameters representation (style=form, explode=false) to a GetYamlResponse value /// as specified in https://swagger.io/docs/specification/serialization/ /// Should be implemented in a serde deserializer -impl std::str::FromStr for InlineObject { +impl std::str::FromStr for GetYamlResponse { type Err = String; fn from_str(s: &str) -> std::result::Result { #[derive(Default)] // An intermediate representation of the struct to use for parsing. struct IntermediateRep { - pub id: Vec, - pub password: Vec, + pub value: Vec, } let mut intermediate_rep = IntermediateRep::default(); @@ -608,14 +610,13 @@ impl std::str::FromStr for InlineObject { while key_result.is_some() { let val = match string_iter.next() { Some(x) => x, - None => return std::result::Result::Err("Missing value while parsing InlineObject".to_string()) + None => return std::result::Result::Err("Missing value while parsing GetYamlResponse".to_string()) }; if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), - "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| format!("{}", x))?), - _ => return std::result::Result::Err("Unexpected key while parsing InlineObject".to_string()) + "value" => intermediate_rep.value.push(::from_str(val).map_err(|x| format!("{}", x))?), + _ => return std::result::Result::Err("Unexpected key while parsing GetYamlResponse".to_string()) } } @@ -624,41 +625,40 @@ impl std::str::FromStr for InlineObject { } // Use the intermediate representation to return the struct - std::result::Result::Ok(InlineObject { - id: intermediate_rep.id.into_iter().next().ok_or("id missing in InlineObject".to_string())?, - password: intermediate_rep.password.into_iter().next(), + std::result::Result::Ok(GetYamlResponse { + value: intermediate_rep.value.into_iter().next(), }) } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", + format!("Invalid header value for GetYamlResponse - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", + format!("Unable to convert header value '{}' into GetYamlResponse - {}", value, err)) } }, diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index 6fbb80b39637..2b63c4e1d2c8 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -235,7 +235,7 @@ impl hyper::service::Service<(Request, C)> for Service where match result { Ok(body) => { let mut unused_elements = Vec::new(); - let param_nested_response: Option = if !body.is_empty() { + let param_nested_response: Option = if !body.is_empty() { let deserializer = &mut serde_json::Deserializer::from_slice(&*body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: 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 d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml index 0f4ef163ed86..3e8e64ad1da4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml @@ -261,13 +261,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -298,14 +292,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -806,24 +793,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -874,77 +844,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1073,16 +973,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1302,16 +1193,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2215,6 +2097,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml index 0f4ef163ed86..3e8e64ad1da4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml @@ -261,13 +261,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -298,14 +292,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -806,24 +793,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -874,77 +844,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1073,16 +973,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1302,16 +1193,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2215,6 +2097,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml index 0f4ef163ed86..3e8e64ad1da4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml @@ -261,13 +261,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -298,14 +292,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -806,24 +793,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -874,77 +844,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1073,16 +973,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1302,16 +1193,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2215,6 +2097,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml index 0f4ef163ed86..3e8e64ad1da4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml @@ -261,13 +261,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -298,14 +292,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -806,24 +793,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -874,77 +844,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1073,16 +973,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1302,16 +1193,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2215,6 +2097,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index d4ba592c4f24..bf1a42764177 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -262,13 +262,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string + $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": content: {} @@ -299,14 +293,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string + $ref: '#/components/schemas/uploadFile_request' responses: "200": content: @@ -807,24 +794,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string + $ref: '#/components/schemas/testEnumParameters_request' responses: "400": content: {} @@ -875,77 +845,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter + $ref: '#/components/schemas/testEndpointParameters_request' required: true responses: "400": @@ -1074,16 +974,7 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 + $ref: '#/components/schemas/testJsonFormData_request' required: true responses: "200": @@ -1303,16 +1194,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' required: true responses: "200": @@ -2221,6 +2103,136 @@ components: xml: namespace: http://a.com/schema prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile Dog_allOf: properties: breed: From 68360cab9297c8f0241320de9165352de7154231 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 10 May 2022 17:16:02 +0800 Subject: [PATCH 2/4] better error messages for oneOf in java okhttp-gson (#12311) --- .../Java/libraries/okhttp-gson/oneof_model.mustache | 8 ++++++-- .../java/org/openapitools/client/model/Fruit.java | 10 ++++++++-- .../java/org/openapitools/client/model/FruitReq.java | 10 ++++++++-- .../java/org/openapitools/client/model/Mammal.java | 12 ++++++++++-- .../org/openapitools/client/model/NullableShape.java | 10 ++++++++-- .../main/java/org/openapitools/client/model/Pig.java | 10 ++++++++-- .../org/openapitools/client/model/Quadrilateral.java | 10 ++++++++-- .../java/org/openapitools/client/model/Shape.java | 10 ++++++++-- .../org/openapitools/client/model/ShapeOrNull.java | 10 ++++++++-- .../java/org/openapitools/client/model/Triangle.java | 12 ++++++++++-- .../test/java/org/openapitools/client/JSONTest.java | 6 +++--- 11 files changed, 85 insertions(+), 23 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache index 1e7748d0ed2a..9b94b365f4c3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache @@ -95,6 +95,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; {{#oneOf}} @@ -107,6 +108,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); } @@ -117,7 +119,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return ret; } - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -210,17 +212,19 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); {{#oneOf}} // validate the json string with {{{.}}} try { {{{.}}}.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); // continue to the next one } {{/oneOf}} if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java index b3f039428acf..4ef91c173457 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java @@ -106,6 +106,7 @@ public Fruit read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize Apple @@ -117,6 +118,7 @@ public Fruit read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Apple'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Apple failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Apple'", e); } @@ -129,6 +131,7 @@ public Fruit read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Banana'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Banana failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } @@ -138,7 +141,7 @@ public Fruit read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -239,11 +242,13 @@ public Banana getBanana() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with Apple try { Apple.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Apple failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Banana @@ -251,10 +256,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Banana.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Banana failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Fruit with oneOf schemas: Apple, Banana. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Fruit with oneOf schemas: Apple, Banana. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java index 546d0cdc7173..67f8741b448e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java @@ -106,6 +106,7 @@ public FruitReq read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize AppleReq @@ -117,6 +118,7 @@ public FruitReq read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'AppleReq'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AppleReq failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e); } @@ -129,6 +131,7 @@ public FruitReq read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'BananaReq'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BananaReq failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e); } @@ -138,7 +141,7 @@ public FruitReq read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -244,11 +247,13 @@ public BananaReq getBananaReq() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with AppleReq try { AppleReq.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AppleReq failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with BananaReq @@ -256,10 +261,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { BananaReq.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BananaReq failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for FruitReq with oneOf schemas: AppleReq, BananaReq. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for FruitReq with oneOf schemas: AppleReq, BananaReq. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java index fe4771cc4cf2..9e03b4034202 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java @@ -138,6 +138,7 @@ public Mammal read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize Pig @@ -149,6 +150,7 @@ public Mammal read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Pig'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Pig'", e); } @@ -161,6 +163,7 @@ public Mammal read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Whale'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Whale'", e); } @@ -173,6 +176,7 @@ public Mammal read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Zebra'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); } @@ -182,7 +186,7 @@ public Mammal read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -306,11 +310,13 @@ public Zebra getZebra() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with Pig try { Pig.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Whale @@ -318,6 +324,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Whale.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Zebra @@ -325,10 +332,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Zebra.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Mammal with oneOf schemas: Pig, Whale, Zebra. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Mammal with oneOf schemas: Pig, Whale, Zebra. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java index beb9bf6f6e40..2c56ae2d3534 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java @@ -125,6 +125,7 @@ public NullableShape read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral @@ -136,6 +137,7 @@ public NullableShape read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); } @@ -148,6 +150,7 @@ public NullableShape read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); } @@ -157,7 +160,7 @@ public NullableShape read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -263,11 +266,13 @@ public Triangle getTriangle() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with Quadrilateral try { Quadrilateral.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Triangle @@ -275,10 +280,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Triangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for NullableShape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for NullableShape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java index 54bbc3b6e183..81e3ad5c06bf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java @@ -125,6 +125,7 @@ public Pig read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize BasquePig @@ -136,6 +137,7 @@ public Pig read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'BasquePig'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BasquePig failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e); } @@ -148,6 +150,7 @@ public Pig read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'DanishPig'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DanishPig failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e); } @@ -157,7 +160,7 @@ public Pig read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -258,11 +261,13 @@ public DanishPig getDanishPig() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with BasquePig try { BasquePig.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BasquePig failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with DanishPig @@ -270,10 +275,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { DanishPig.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DanishPig failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java index 61b9d62aa028..14699135de60 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -125,6 +125,7 @@ public Quadrilateral read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize ComplexQuadrilateral @@ -136,6 +137,7 @@ public Quadrilateral read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ComplexQuadrilateral failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e); } @@ -148,6 +150,7 @@ public Quadrilateral read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SimpleQuadrilateral failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e); } @@ -157,7 +160,7 @@ public Quadrilateral read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -258,11 +261,13 @@ public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with ComplexQuadrilateral try { ComplexQuadrilateral.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ComplexQuadrilateral failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with SimpleQuadrilateral @@ -270,10 +275,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { SimpleQuadrilateral.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SimpleQuadrilateral failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Quadrilateral with oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Quadrilateral with oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java index 8c0c9b2fc8b8..a2a9054865a7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java @@ -125,6 +125,7 @@ public Shape read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral @@ -136,6 +137,7 @@ public Shape read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); } @@ -148,6 +150,7 @@ public Shape read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); } @@ -157,7 +160,7 @@ public Shape read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -258,11 +261,13 @@ public Triangle getTriangle() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with Quadrilateral try { Quadrilateral.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Triangle @@ -270,10 +275,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Triangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Shape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Shape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 28badafc0399..72367d230603 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -125,6 +125,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral @@ -136,6 +137,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); } @@ -148,6 +150,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); } @@ -157,7 +160,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -263,11 +266,13 @@ public Triangle getTriangle() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with Quadrilateral try { Quadrilateral.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Quadrilateral failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with Triangle @@ -275,10 +280,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Triangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Triangle failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for ShapeOrNull with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for ShapeOrNull with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java index 3dea796aea18..512cd7fbf1a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java @@ -138,6 +138,7 @@ public Triangle read(JsonReader in) throws IOException { } int match = 0; + ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize EquilateralTriangle @@ -149,6 +150,7 @@ public Triangle read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for EquilateralTriangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e); } @@ -161,6 +163,7 @@ public Triangle read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IsoscelesTriangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e); } @@ -173,6 +176,7 @@ public Triangle read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); } catch (Exception e) { // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ScaleneTriangle failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e); } @@ -182,7 +186,7 @@ public Triangle read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -306,11 +310,13 @@ public ScaleneTriangle getScaleneTriangle() throws ClassCastException { public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); // validate the json string with EquilateralTriangle try { EquilateralTriangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for EquilateralTriangle failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with IsoscelesTriangle @@ -318,6 +324,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { IsoscelesTriangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IsoscelesTriangle failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with ScaleneTriangle @@ -325,10 +332,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ScaleneTriangle.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ScaleneTriangle failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Triangle with oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for Triangle with oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java index b24033df2e98..889ac0719087 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -429,7 +429,7 @@ public void testOneOfSchemaWithDiscriminator() throws Exception { Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { Mammal o = json.getGson().fromJson(str, Mammal.class); }); - assertTrue(exception.getMessage().contains("Failed deserialization for Mammal: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); + assertEquals("java.io.IOException: Failed deserialization for Mammal: 0 classes match result, expected 1. Detailed failure message for oneOf schemas: [Deserialization for Pig failed with `The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. 0 class(es) match the result, expected 1. Detailed failure message for oneOf schemas: [Deserialization for BasquePig failed with `The required field `className` is not found in the JSON string: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`., Deserialization for DanishPig failed with `The required field `className` is not found in the JSON string: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`.]. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`., Deserialization for Whale failed with `The required field `className` is not found in the JSON string: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`., Deserialization for Zebra failed with `The required field `className` is not found in the JSON string: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`.]. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}", exception.getMessage()); } { // Try to deserialize empty object. This should fail 'oneOf' because none will match @@ -438,7 +438,7 @@ public void testOneOfSchemaWithDiscriminator() throws Exception { Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { json.getGson().fromJson(str, Mammal.class); }); - assertTrue(exception.getMessage().contains("Failed deserialization for Mammal: 0 classes match result, expected 1")); + assertEquals("java.io.IOException: Failed deserialization for Mammal: 0 classes match result, expected 1. Detailed failure message for oneOf schemas: [Deserialization for Pig failed with `The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. 0 class(es) match the result, expected 1. Detailed failure message for oneOf schemas: [Deserialization for BasquePig failed with `The required field `className` is not found in the JSON string: {}`., Deserialization for DanishPig failed with `The required field `className` is not found in the JSON string: {}`.]. JSON: {}`., Deserialization for Whale failed with `The required field `className` is not found in the JSON string: {}`., Deserialization for Zebra failed with `The required field `className` is not found in the JSON string: {}`.]. JSON: {}", exception.getMessage()); } } @@ -517,7 +517,7 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { FruitReq o = json.getGson().fromJson(str, FruitReq.class); }); - assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); + assertEquals("java.io.IOException: Failed deserialization for FruitReq: 0 classes match result, expected 1. Detailed failure message for oneOf schemas: [Deserialization for AppleReq failed with `The field `garbage_prop` in the JSON string is not defined in the `AppleReq` properties. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`., Deserialization for BananaReq failed with `The field `cultivar` in the JSON string is not defined in the `BananaReq` properties. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}`.]. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}", exception.getMessage()); } { String str = "{ \"lengthCm\": 17 }"; From 884a74550a7d7f7b901ea9a7067c71f8650a0fd2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 10 May 2022 17:23:13 +0800 Subject: [PATCH 3/4] add tests to set httpUserAgent in r client (#12321) --- bin/configs/r-client.yaml | 1 + samples/client/petstore/R/R/api_client.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/configs/r-client.yaml b/bin/configs/r-client.yaml index 1de2699e1d95..98a79ecb29ef 100644 --- a/bin/configs/r-client.yaml +++ b/bin/configs/r-client.yaml @@ -2,5 +2,6 @@ generatorName: r outputDir: samples/client/petstore/R inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/r +httpUserAgent: PetstoreAgent additionalProperties: packageName: petstore diff --git a/samples/client/petstore/R/R/api_client.R b/samples/client/petstore/R/R/api_client.R index 52ede81af0d0..533e8ea9daed 100644 --- a/samples/client/petstore/R/R/api_client.R +++ b/samples/client/petstore/R/R/api_client.R @@ -41,7 +41,7 @@ ApiClient <- R6::R6Class( # base path of all requests basePath = "http://petstore.swagger.io/v2", # user agent in the HTTP request - userAgent = "OpenAPI-Generator/1.0.0/r", + userAgent = "PetstoreAgent", # default headers in the HTTP request defaultHeaders = NULL, # username (HTTP basic authentication) From 6931f15e8063238c8d3bdeebfb1d2687bd46d5f6 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 10 May 2022 11:28:44 +0200 Subject: [PATCH 4/4] Add martindelille to code owners (#12328) --- .github/CODEOWNERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 73eb45d0ee88..416f9199ba27 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -28,3 +28,8 @@ modules/openapi-generator-cli/**/* @jimschubert modules/openapi-generator-gradle-plugin/**/* @jimschubert modules/openapi-generator-maven-plugin/**/* @jimschubert +# Martin Delille +/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @martindelille +/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java @martindelille +/Users/martin/dev/clone/openapi-generator/modules/openapi-generator/src/main/resources/cpp-qt-client @martindelille +/Users/martin/dev/clone/openapi-generator/samples/client/petstore/cpp-qt @martindelille