diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 2f0fb16375c..4bf21511eae 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -578,6 +578,17 @@ protected void generateEndpoints(OperationsMap objs) { outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod, "__init__.py")); pathsFiles.add(Arrays.asList(endpointMap, "endpoint.handlebars", outputFilename)); + // paths.some_path.post.request_body.py + if (co.bodyParam != null) { + Map paramMap = new HashMap<>(); + paramMap.put("requestBody", co.bodyParam); + // TODO consolidate imports into body param only + paramMap.put("imports", co.imports); + paramMap.put("packageName", packageName); + outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod, "request_body.py")); + pathsFiles.add(Arrays.asList(paramMap, "endpoint_request_body.handlebars", outputFilename)); + } + for (CodegenResponse response: co.responses) { // paths.some_path.post.response_for_200.py (file per response) Map responseMap = new HashMap<>(); diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars index b1141380890..60134a4a78a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_doc.handlebars @@ -49,7 +49,7 @@ Method | HTTP request | Description Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- {{#with bodyParam}} -[{{baseName}}](#{{operationId}}.RequestBody) | typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{#with this.schema}}[RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{../operationId}}.RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/with}}{{/each}}{{#unless required}}, Unset]{{else}}]{{/unless}} | {{#if required}}required{{else}}optional, default is unset{{/if}} | +[{{baseName}}](#{{operationId}}.request_body) | typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{#with this.schema}}[request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}](#{{../operationId}}.request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}){{/with}}{{/each}}{{#unless required}}, Unset]{{else}}]{{/unless}} | {{#if required}}required{{else}}optional, default is unset{{/if}} | {{/with}} {{#if queryParams}} [query_params](#{{operationId}}.RequestQueryParameters) | [RequestQueryParameters.Params](#{{operationId}}.RequestQueryParameters.Params) | | @@ -81,10 +81,10 @@ timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | t skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned {{#with bodyParam}} -### body +### body {{#each content}} {{#with this.schema}} -{{> api_doc_schema_type_hint anchorPrefix=../operationId schemaNamePrefix1="RequestBody.Schemas." complexTypePrefix="../../models/" }} +{{> api_doc_schema_type_hint anchorPrefix=../operationId schemaNamePrefix1="request_body." complexTypePrefix="../../models/" }} {{/with}} {{/each}} {{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars index 86d85596910..2155eaf2182 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_test.handlebars @@ -109,7 +109,7 @@ class Test{{operationIdSnakeCase}}(ApiTestMixin, unittest.TestCase): {{/with}} ) {{#if valid}} - body = {{httpMethod}}.RequestBody.Schemas.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}.from_openapi_data_oapg( + body = {{httpMethod}}.request_body.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -123,7 +123,7 @@ class Test{{operationIdSnakeCase}}(ApiTestMixin, unittest.TestCase): assert isinstance(api_response.body, schemas.Unset) {{else}} with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - body = {{httpMethod}}.RequestBody.Schemas.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}.from_openapi_data_oapg( + body = {{httpMethod}}.request_body.{{#if schema.nameInSnakeCase}}{{schema.name}}{{else}}{{schema.baseName}}{{/if}}.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars index 601a5e4b533..6c5c7d7e4e6 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars @@ -22,6 +22,9 @@ from .. import path {{#each responses}} from . import response_for_{{#if isDefault}}default{{else}}{{code}}{{/if}} {{/each}} +{{#if bodyParam}} +from . import request_body +{{/if}} {{#or queryParams headerParams pathParams cookieParams}} {{#if queryParams}} @@ -37,38 +40,6 @@ from . import response_for_{{#if isDefault}}default{{else}}{{code}}{{/if}} {{> endpoint_parameter_schema_and_def xParams=cookieParams xParamsName="RequestCookieParameters" }} {{/if}} {{/or}} -{{#if bodyParam}} -{{#with bodyParam}} - - -class RequestBody: - class Schemas: - {{#each content}} - {{#with this}} - {{#with schema}} - {{> model_templates/schema }} - {{/with}} - {{/with}} - {{/each}} - - parameter = api_client.RequestBody( - content={ - {{#each content}} - '{{{@key}}}': api_client.MediaType( - {{#with this}} - {{#with schema}} - schema=Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} - {{/with}} - {{/with}} - ), - {{/each}} - }, - {{#if required}} - required=True, - {{/if}} - ) -{{/with}} -{{/if}} {{#unless isStub}} {{#each authMethods}} {{#if @first}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars index d2038c9bf49..59f81e17694 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_args.handlebars @@ -3,9 +3,9 @@ {{#if bodyParam.required}} {{#with bodyParam}} {{#eq ../contentType "null"}} - body: typing.Union[{{#each getContent}}{{#with this.schema}}RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}], + body: typing.Union[{{#each getContent}}{{#with this.schema}}request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}], {{else}} - body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}},{{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}], + body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}},{{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}], {{/eq}} {{/with}} {{#if isOverload}} @@ -67,9 +67,9 @@ {{/if}} {{#with bodyParam}} {{#eq ../contentType "null"}} - body: typing.Union[{{#each getContent}}{{#with this.schema}}RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}, {{> model_templates/schema_python_types }}{{/with}}{{/each}}schemas.Unset] = schemas.unset, + body: typing.Union[{{#each getContent}}{{#with this.schema}}request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}, {{> model_templates/schema_python_types }}{{/with}}{{/each}}schemas.Unset] = schemas.unset, {{else}} - body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}RequestBody.Schemas.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}, {{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}schemas.Unset] = schemas.unset, + body: typing.Union[{{#each getContent}}{{#eq @key ../../contentType }}{{#with this.schema}}request_body.{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}, {{> model_templates/schema_python_types }}{{/with}}{{/eq}}{{/each}}schemas.Unset] = schemas.unset, {{/eq}} {{/with}} {{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars index 8d9b9d2fe0b..16be1b59f70 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars @@ -1,4 +1,4 @@ -serialized_data = RequestBody.parameter.serialize(body, content_type) +serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_request_body.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_request_body.handlebars new file mode 100644 index 00000000000..02496e1b3e8 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_request_body.handlebars @@ -0,0 +1,39 @@ +# coding: utf-8 + +{{>partial_header}} + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from {{packageName}} import api_client, exceptions +{{> model_templates/imports_schema_types }} +{{> model_templates/imports_schemas }} +{{#with requestBody}} + + +{{#each content}} +{{#with this}} + {{#with schema}} +{{> model_templates/schema }} + {{/with}} +{{/with}} +{{/each}} + +parameter_oapg = api_client.RequestBody( + content={ +{{#each content}} + '{{{@key}}}': api_client.MediaType( + {{#with this}} + {{#with schema}} + schema={{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}} + {{/with}} + {{/with}} + ), +{{/each}} + }, +{{#if required}} + required=True, +{{/if}} +) +{{/with}} diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md index e0276631c63..4757a310c04 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md @@ -52,15 +52,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | @@ -178,15 +178,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_are_allowed_by_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_are_allowed_by_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | @@ -306,15 +306,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_can_exist_by_itself_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_can_exist_by_itself_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | @@ -432,15 +432,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md index feddca2d676..0ab59442d7d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md @@ -59,15 +59,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_combined_with_anyof_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_combined_with_anyof_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_combined_with_anyof_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_combined_with_anyof_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | @@ -185,15 +185,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Allof**](../../models/Allof.md) | | @@ -311,15 +311,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_simple_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_simple_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_simple_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_simple_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | @@ -437,15 +437,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | @@ -563,15 +563,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | @@ -689,15 +689,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_first_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_first_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_first_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_first_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | @@ -815,15 +815,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_last_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_last_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_last_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_last_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | @@ -941,15 +941,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_two_empty_schemas_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_two_empty_schemas_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_two_empty_schemas_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_two_empty_schemas_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | @@ -1067,15 +1067,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_allof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_allof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md index efcd9a6953f..64aad080c16 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md @@ -51,15 +51,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | @@ -177,15 +177,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Anyof**](../../models/Anyof.md) | | @@ -303,15 +303,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | @@ -429,15 +429,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | @@ -555,15 +555,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_anyof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md index 9b6065023bc..0eee1eb87d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md @@ -218,15 +218,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | @@ -344,15 +344,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_are_allowed_by_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_are_allowed_by_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | @@ -472,15 +472,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_can_exist_by_itself_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_can_exist_by_itself_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | @@ -598,15 +598,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | @@ -724,15 +724,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_combined_with_anyof_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_combined_with_anyof_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_combined_with_anyof_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_combined_with_anyof_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | @@ -850,15 +850,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Allof**](../../models/Allof.md) | | @@ -976,15 +976,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_simple_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_simple_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_simple_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_simple_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | @@ -1102,15 +1102,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | @@ -1228,15 +1228,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | @@ -1354,15 +1354,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_first_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_first_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_first_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_first_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | @@ -1480,15 +1480,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_last_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_last_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_last_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_last_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | @@ -1606,15 +1606,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_two_empty_schemas_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_two_empty_schemas_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_two_empty_schemas_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_two_empty_schemas_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | @@ -1732,15 +1732,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | @@ -1858,15 +1858,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Anyof**](../../models/Anyof.md) | | @@ -1984,15 +1984,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | @@ -2110,15 +2110,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | @@ -2238,15 +2238,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_array_type_matches_arrays_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_array_type_matches_arrays_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_array_type_matches_arrays_request_body.request_body) | typing.Union[[request_body.application_json](#post_array_type_matches_arrays_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | @@ -2364,15 +2364,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_boolean_type_matches_booleans_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_boolean_type_matches_booleans_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_boolean_type_matches_booleans_request_body.request_body) | typing.Union[[request_body.application_json](#post_boolean_type_matches_booleans_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BooleanTypeMatchesBooleans**](../../models/BooleanTypeMatchesBooleans.md) | | @@ -2490,15 +2490,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_int_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_int_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_int_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_int_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByInt**](../../models/ByInt.md) | | @@ -2616,15 +2616,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByNumber**](../../models/ByNumber.md) | | @@ -2742,15 +2742,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_small_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_small_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_small_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_small_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BySmallNumber**](../../models/BySmallNumber.md) | | @@ -2868,15 +2868,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_date_time_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_date_time_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_date_time_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_date_time_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**DateTimeFormat**](../../models/DateTimeFormat.md) | | @@ -2994,15 +2994,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_email_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_email_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_email_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_email_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EmailFormat**](../../models/EmailFormat.md) | | @@ -3120,15 +3120,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with0_does_not_match_false_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with0_does_not_match_false_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with0_does_not_match_false_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with0_does_not_match_false_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | @@ -3246,15 +3246,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with1_does_not_match_true_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with1_does_not_match_true_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with1_does_not_match_true_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with1_does_not_match_true_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | @@ -3372,15 +3372,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | @@ -3498,15 +3498,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_false_does_not_match0_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_false_does_not_match0_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_false_does_not_match0_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_false_does_not_match0_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | @@ -3624,15 +3624,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_true_does_not_match1_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_true_does_not_match1_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_true_does_not_match1_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_true_does_not_match1_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | @@ -3753,15 +3753,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enums_in_properties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enums_in_properties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enums_in_properties_request_body.request_body) | typing.Union[[request_body.application_json](#post_enums_in_properties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumsInProperties**](../../models/EnumsInProperties.md) | | @@ -3879,15 +3879,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_forbidden_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_forbidden_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_forbidden_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_forbidden_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | @@ -4005,15 +4005,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_hostname_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_hostname_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_hostname_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_hostname_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**HostnameFormat**](../../models/HostnameFormat.md) | | @@ -4131,15 +4131,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_integer_type_matches_integers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_integer_type_matches_integers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_integer_type_matches_integers_request_body.request_body) | typing.Union[[request_body.application_json](#post_integer_type_matches_integers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**IntegerTypeMatchesIntegers**](../../models/IntegerTypeMatchesIntegers.md) | | @@ -4257,15 +4257,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | @@ -4383,15 +4383,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_string_value_for_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_string_value_for_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_string_value_for_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_string_value_for_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | @@ -4509,15 +4509,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv4_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv4_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv4_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv4_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv4Format**](../../models/Ipv4Format.md) | | @@ -4635,15 +4635,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv6_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv6_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv6_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv6_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv6Format**](../../models/Ipv6Format.md) | | @@ -4761,15 +4761,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_json_pointer_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_json_pointer_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_json_pointer_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_json_pointer_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**JsonPointerFormat**](../../models/JsonPointerFormat.md) | | @@ -4887,15 +4887,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidation**](../../models/MaximumValidation.md) | | @@ -5013,15 +5013,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_with_unsigned_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_with_unsigned_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | @@ -5139,15 +5139,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | @@ -5265,15 +5265,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | @@ -5391,15 +5391,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties0_means_the_object_is_empty_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | @@ -5517,15 +5517,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | @@ -5643,15 +5643,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidation**](../../models/MinimumValidation.md) | | @@ -5769,15 +5769,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_with_signed_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_with_signed_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_with_signed_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_with_signed_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | @@ -5895,15 +5895,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinitemsValidation**](../../models/MinitemsValidation.md) | | @@ -6021,15 +6021,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinlengthValidation**](../../models/MinlengthValidation.md) | | @@ -6147,15 +6147,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | @@ -6273,15 +6273,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_allof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_allof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | @@ -6399,15 +6399,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_anyof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | @@ -6533,15 +6533,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedItems**](../../models/NestedItems.md) | | @@ -6659,15 +6659,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_oneof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | @@ -6785,15 +6785,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_more_complex_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_more_complex_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_more_complex_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_more_complex_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NotMoreComplexSchema**](../../models/NotMoreComplexSchema.md) | | @@ -6911,15 +6911,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ModelNot**](../../models/ModelNot.md) | | @@ -7037,15 +7037,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nul_characters_in_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nul_characters_in_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nul_characters_in_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_nul_characters_in_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | @@ -7163,15 +7163,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_null_type_matches_only_the_null_object_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_null_type_matches_only_the_null_object_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_null_type_matches_only_the_null_object_request_body.request_body) | typing.Union[[request_body.application_json](#post_null_type_matches_only_the_null_object_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NullTypeMatchesOnlyTheNullObject**](../../models/NullTypeMatchesOnlyTheNullObject.md) | | @@ -7289,15 +7289,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_number_type_matches_numbers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_number_type_matches_numbers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_number_type_matches_numbers_request_body.request_body) | typing.Union[[request_body.application_json](#post_number_type_matches_numbers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NumberTypeMatchesNumbers**](../../models/NumberTypeMatchesNumbers.md) | | @@ -7415,15 +7415,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_properties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_properties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_properties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_properties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | @@ -7541,15 +7541,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_type_matches_objects_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_type_matches_objects_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_type_matches_objects_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_type_matches_objects_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectTypeMatchesObjects**](../../models/ObjectTypeMatchesObjects.md) | | @@ -7667,15 +7667,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | @@ -7793,15 +7793,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Oneof**](../../models/Oneof.md) | | @@ -7919,15 +7919,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | @@ -8045,15 +8045,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | @@ -8171,15 +8171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_required_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_required_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_required_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_required_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithRequired**](../../models/OneofWithRequired.md) | | @@ -8297,15 +8297,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_is_not_anchored_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_is_not_anchored_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_is_not_anchored_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_is_not_anchored_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | @@ -8423,15 +8423,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternValidation**](../../models/PatternValidation.md) | | @@ -8549,15 +8549,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_properties_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_properties_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_properties_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_properties_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | @@ -8675,15 +8675,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_property_named_ref_that_is_not_a_reference_request_body.request_body) | typing.Union[[request_body.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | @@ -8803,15 +8803,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_additionalproperties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_additionalproperties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_additionalproperties_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_additionalproperties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | @@ -8929,15 +8929,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAllof**](../../models/RefInAllof.md) | | @@ -9055,15 +9055,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAnyof**](../../models/RefInAnyof.md) | | @@ -9183,15 +9183,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInItems**](../../models/RefInItems.md) | | @@ -9309,15 +9309,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInNot**](../../models/RefInNot.md) | | @@ -9435,15 +9435,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInOneof**](../../models/RefInOneof.md) | | @@ -9561,15 +9561,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInProperty**](../../models/RefInProperty.md) | | @@ -9687,15 +9687,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_default_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_default_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_default_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_default_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | @@ -9813,15 +9813,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredValidation**](../../models/RequiredValidation.md) | | @@ -9939,15 +9939,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_empty_array_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_empty_array_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_empty_array_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_empty_array_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | @@ -10065,15 +10065,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEscapedCharacters**](../../models/RequiredWithEscapedCharacters.md) | | @@ -10191,15 +10191,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_simple_enum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_simple_enum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_simple_enum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_simple_enum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | @@ -10317,15 +10317,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_string_type_matches_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_string_type_matches_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_string_type_matches_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_string_type_matches_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**StringTypeMatchesStrings**](../../models/StringTypeMatchesStrings.md) | | @@ -10445,15 +10445,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body) | typing.Union[[request_body.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | @@ -10571,15 +10571,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_false_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_false_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_false_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_false_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | @@ -10697,15 +10697,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | @@ -10823,15 +10823,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriFormat**](../../models/UriFormat.md) | | @@ -10949,15 +10949,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_reference_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_reference_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_reference_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_reference_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriReferenceFormat**](../../models/UriReferenceFormat.md) | | @@ -11075,15 +11075,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_template_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_template_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_template_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_template_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriTemplateFormat**](../../models/UriTemplateFormat.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md index 3670142f4d8..4276d3f12b4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_string_value_for_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_string_value_for_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_string_value_for_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_string_value_for_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | @@ -173,15 +173,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body) | typing.Union[[request_body.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md index b0635858e00..3b2231ac97f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md @@ -57,15 +57,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with0_does_not_match_false_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with0_does_not_match_false_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with0_does_not_match_false_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with0_does_not_match_false_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | @@ -183,15 +183,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with1_does_not_match_true_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with1_does_not_match_true_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with1_does_not_match_true_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with1_does_not_match_true_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | @@ -309,15 +309,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | @@ -435,15 +435,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_false_does_not_match0_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_false_does_not_match0_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_false_does_not_match0_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_false_does_not_match0_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | @@ -561,15 +561,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_true_does_not_match1_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_true_does_not_match1_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_true_does_not_match1_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_true_does_not_match1_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | @@ -690,15 +690,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enums_in_properties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enums_in_properties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enums_in_properties_request_body.request_body) | typing.Union[[request_body.application_json](#post_enums_in_properties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumsInProperties**](../../models/EnumsInProperties.md) | | @@ -816,15 +816,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nul_characters_in_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nul_characters_in_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nul_characters_in_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_nul_characters_in_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | @@ -942,15 +942,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_simple_enum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_simple_enum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_simple_enum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_simple_enum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md index 1eb9c5d3d0b..113c1793cfb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md @@ -59,15 +59,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_date_time_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_date_time_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_date_time_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_date_time_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**DateTimeFormat**](../../models/DateTimeFormat.md) | | @@ -185,15 +185,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_email_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_email_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_email_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_email_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EmailFormat**](../../models/EmailFormat.md) | | @@ -311,15 +311,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_hostname_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_hostname_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_hostname_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_hostname_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**HostnameFormat**](../../models/HostnameFormat.md) | | @@ -437,15 +437,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv4_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv4_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv4_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv4_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv4Format**](../../models/Ipv4Format.md) | | @@ -563,15 +563,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv6_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv6_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv6_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv6_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv6Format**](../../models/Ipv6Format.md) | | @@ -689,15 +689,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_json_pointer_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_json_pointer_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_json_pointer_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_json_pointer_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**JsonPointerFormat**](../../models/JsonPointerFormat.md) | | @@ -815,15 +815,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriFormat**](../../models/UriFormat.md) | | @@ -941,15 +941,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_reference_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_reference_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_reference_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_reference_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriReferenceFormat**](../../models/UriReferenceFormat.md) | | @@ -1067,15 +1067,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_template_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_template_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_template_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_template_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriTemplateFormat**](../../models/UriTemplateFormat.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md index e1af6fb8716..8418869b055 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md @@ -51,15 +51,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedItems**](../../models/NestedItems.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md index 835ff85e7f5..87c5958a398 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md @@ -43,15 +43,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md index e6c9f74f254..379cec8ba54 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md @@ -43,15 +43,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md index 46fb9b9bf41..219fe352da1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties0_means_the_object_is_empty_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md index d5e7884efe3..0a8c162ae71 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidation**](../../models/MaximumValidation.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_with_unsigned_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_with_unsigned_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md index 6058a8c5e42..129d0275299 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md @@ -43,15 +43,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinitemsValidation**](../../models/MinitemsValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md index 8a9e64df109..efc42914794 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md @@ -43,15 +43,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinlengthValidation**](../../models/MinlengthValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md index e67e4dfe632..66081273e3b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md @@ -43,15 +43,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md index 8d498544493..43252b0628d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidation**](../../models/MinimumValidation.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_with_signed_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_with_signed_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_with_signed_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_with_signed_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md index c5e1f4af462..13ac43ee190 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md @@ -47,15 +47,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_forbidden_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_forbidden_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_forbidden_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_forbidden_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | @@ -173,15 +173,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_more_complex_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_more_complex_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_more_complex_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_more_complex_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NotMoreComplexSchema**](../../models/NotMoreComplexSchema.md) | | @@ -299,15 +299,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ModelNot**](../../models/ModelNot.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md index 5bd7a567eb6..148e5536b9d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md @@ -49,15 +49,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_int_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_int_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_int_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_int_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByInt**](../../models/ByInt.md) | | @@ -175,15 +175,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByNumber**](../../models/ByNumber.md) | | @@ -301,15 +301,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_small_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_small_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_small_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_small_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BySmallNumber**](../../models/BySmallNumber.md) | | @@ -427,15 +427,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md index 36d4871b16a..915e5094338 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md @@ -53,15 +53,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_oneof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | @@ -179,15 +179,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | @@ -305,15 +305,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Oneof**](../../models/Oneof.md) | | @@ -431,15 +431,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | @@ -557,15 +557,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | @@ -683,15 +683,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_required_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_required_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_required_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_required_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithRequired**](../../models/OneofWithRequired.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md index 0dd8ffcb6ed..525f81aeedd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md @@ -131,15 +131,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | @@ -200,15 +200,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_are_allowed_by_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_are_allowed_by_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | @@ -271,15 +271,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_can_exist_by_itself_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_can_exist_by_itself_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | @@ -340,15 +340,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | @@ -409,15 +409,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_combined_with_anyof_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_combined_with_anyof_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_combined_with_anyof_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_combined_with_anyof_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | @@ -478,15 +478,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Allof**](../../models/Allof.md) | | @@ -547,15 +547,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_simple_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_simple_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_simple_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_simple_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | @@ -616,15 +616,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | @@ -685,15 +685,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | @@ -754,15 +754,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_first_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_first_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_first_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_first_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | @@ -823,15 +823,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_last_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_last_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_last_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_last_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | @@ -892,15 +892,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_two_empty_schemas_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_two_empty_schemas_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_two_empty_schemas_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_two_empty_schemas_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | @@ -961,15 +961,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | @@ -1030,15 +1030,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Anyof**](../../models/Anyof.md) | | @@ -1099,15 +1099,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | @@ -1168,15 +1168,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | @@ -1239,15 +1239,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_array_type_matches_arrays_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_array_type_matches_arrays_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_array_type_matches_arrays_request_body.request_body) | typing.Union[[request_body.application_json](#post_array_type_matches_arrays_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | @@ -1308,15 +1308,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_boolean_type_matches_booleans_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_boolean_type_matches_booleans_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_boolean_type_matches_booleans_request_body.request_body) | typing.Union[[request_body.application_json](#post_boolean_type_matches_booleans_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BooleanTypeMatchesBooleans**](../../models/BooleanTypeMatchesBooleans.md) | | @@ -1377,15 +1377,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_int_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_int_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_int_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_int_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByInt**](../../models/ByInt.md) | | @@ -1446,15 +1446,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByNumber**](../../models/ByNumber.md) | | @@ -1515,15 +1515,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_small_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_small_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_small_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_small_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BySmallNumber**](../../models/BySmallNumber.md) | | @@ -1584,15 +1584,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_date_time_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_date_time_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_date_time_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_date_time_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**DateTimeFormat**](../../models/DateTimeFormat.md) | | @@ -1653,15 +1653,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_email_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_email_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_email_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_email_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EmailFormat**](../../models/EmailFormat.md) | | @@ -1722,15 +1722,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with0_does_not_match_false_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with0_does_not_match_false_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with0_does_not_match_false_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with0_does_not_match_false_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | @@ -1791,15 +1791,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with1_does_not_match_true_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with1_does_not_match_true_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with1_does_not_match_true_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with1_does_not_match_true_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | @@ -1860,15 +1860,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | @@ -1929,15 +1929,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_false_does_not_match0_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_false_does_not_match0_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_false_does_not_match0_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_false_does_not_match0_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | @@ -1998,15 +1998,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_true_does_not_match1_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_true_does_not_match1_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_true_does_not_match1_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_true_does_not_match1_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | @@ -2070,15 +2070,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enums_in_properties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enums_in_properties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enums_in_properties_request_body.request_body) | typing.Union[[request_body.application_json](#post_enums_in_properties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumsInProperties**](../../models/EnumsInProperties.md) | | @@ -2139,15 +2139,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_forbidden_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_forbidden_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_forbidden_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_forbidden_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | @@ -2208,15 +2208,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_hostname_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_hostname_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_hostname_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_hostname_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**HostnameFormat**](../../models/HostnameFormat.md) | | @@ -2277,15 +2277,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_integer_type_matches_integers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_integer_type_matches_integers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_integer_type_matches_integers_request_body.request_body) | typing.Union[[request_body.application_json](#post_integer_type_matches_integers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**IntegerTypeMatchesIntegers**](../../models/IntegerTypeMatchesIntegers.md) | | @@ -2346,15 +2346,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | @@ -2415,15 +2415,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_string_value_for_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_string_value_for_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_string_value_for_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_string_value_for_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | @@ -2484,15 +2484,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv4_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv4_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv4_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv4_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv4Format**](../../models/Ipv4Format.md) | | @@ -2553,15 +2553,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv6_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv6_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv6_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv6_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv6Format**](../../models/Ipv6Format.md) | | @@ -2622,15 +2622,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_json_pointer_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_json_pointer_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_json_pointer_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_json_pointer_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**JsonPointerFormat**](../../models/JsonPointerFormat.md) | | @@ -2691,15 +2691,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidation**](../../models/MaximumValidation.md) | | @@ -2760,15 +2760,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_with_unsigned_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_with_unsigned_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | @@ -2829,15 +2829,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | @@ -2898,15 +2898,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | @@ -2967,15 +2967,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties0_means_the_object_is_empty_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | @@ -3036,15 +3036,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | @@ -3105,15 +3105,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidation**](../../models/MinimumValidation.md) | | @@ -3174,15 +3174,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_with_signed_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_with_signed_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_with_signed_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_with_signed_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | @@ -3243,15 +3243,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinitemsValidation**](../../models/MinitemsValidation.md) | | @@ -3312,15 +3312,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinlengthValidation**](../../models/MinlengthValidation.md) | | @@ -3381,15 +3381,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | @@ -3450,15 +3450,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_allof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_allof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | @@ -3519,15 +3519,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_anyof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | @@ -3596,15 +3596,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedItems**](../../models/NestedItems.md) | | @@ -3665,15 +3665,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_oneof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | @@ -3734,15 +3734,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_more_complex_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_more_complex_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_more_complex_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_more_complex_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NotMoreComplexSchema**](../../models/NotMoreComplexSchema.md) | | @@ -3803,15 +3803,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ModelNot**](../../models/ModelNot.md) | | @@ -3872,15 +3872,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nul_characters_in_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nul_characters_in_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nul_characters_in_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_nul_characters_in_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | @@ -3941,15 +3941,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_null_type_matches_only_the_null_object_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_null_type_matches_only_the_null_object_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_null_type_matches_only_the_null_object_request_body.request_body) | typing.Union[[request_body.application_json](#post_null_type_matches_only_the_null_object_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NullTypeMatchesOnlyTheNullObject**](../../models/NullTypeMatchesOnlyTheNullObject.md) | | @@ -4010,15 +4010,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_number_type_matches_numbers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_number_type_matches_numbers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_number_type_matches_numbers_request_body.request_body) | typing.Union[[request_body.application_json](#post_number_type_matches_numbers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NumberTypeMatchesNumbers**](../../models/NumberTypeMatchesNumbers.md) | | @@ -4079,15 +4079,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_properties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_properties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_properties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_properties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | @@ -4148,15 +4148,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_type_matches_objects_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_type_matches_objects_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_type_matches_objects_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_type_matches_objects_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectTypeMatchesObjects**](../../models/ObjectTypeMatchesObjects.md) | | @@ -4217,15 +4217,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | @@ -4286,15 +4286,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Oneof**](../../models/Oneof.md) | | @@ -4355,15 +4355,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | @@ -4424,15 +4424,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | @@ -4493,15 +4493,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_required_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_required_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_required_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_required_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithRequired**](../../models/OneofWithRequired.md) | | @@ -4562,15 +4562,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_is_not_anchored_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_is_not_anchored_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_is_not_anchored_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_is_not_anchored_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | @@ -4631,15 +4631,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternValidation**](../../models/PatternValidation.md) | | @@ -4700,15 +4700,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_properties_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_properties_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_properties_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_properties_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | @@ -4769,15 +4769,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_property_named_ref_that_is_not_a_reference_request_body.request_body) | typing.Union[[request_body.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | @@ -4840,15 +4840,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_additionalproperties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_additionalproperties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_additionalproperties_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_additionalproperties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | @@ -4909,15 +4909,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAllof**](../../models/RefInAllof.md) | | @@ -4978,15 +4978,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAnyof**](../../models/RefInAnyof.md) | | @@ -5049,15 +5049,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInItems**](../../models/RefInItems.md) | | @@ -5118,15 +5118,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInNot**](../../models/RefInNot.md) | | @@ -5187,15 +5187,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInOneof**](../../models/RefInOneof.md) | | @@ -5256,15 +5256,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInProperty**](../../models/RefInProperty.md) | | @@ -5325,15 +5325,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_default_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_default_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_default_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_default_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | @@ -5394,15 +5394,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredValidation**](../../models/RequiredValidation.md) | | @@ -5463,15 +5463,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_empty_array_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_empty_array_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_empty_array_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_empty_array_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | @@ -5532,15 +5532,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEscapedCharacters**](../../models/RequiredWithEscapedCharacters.md) | | @@ -5601,15 +5601,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_simple_enum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_simple_enum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_simple_enum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_simple_enum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | @@ -5670,15 +5670,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_string_type_matches_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_string_type_matches_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_string_type_matches_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_string_type_matches_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**StringTypeMatchesStrings**](../../models/StringTypeMatchesStrings.md) | | @@ -5741,15 +5741,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body) | typing.Union[[request_body.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | @@ -5810,15 +5810,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_false_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_false_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_false_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_false_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | @@ -5879,15 +5879,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | @@ -5948,15 +5948,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriFormat**](../../models/UriFormat.md) | | @@ -6017,15 +6017,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_reference_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_reference_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_reference_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_reference_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriReferenceFormat**](../../models/UriReferenceFormat.md) | | @@ -6086,15 +6086,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_template_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_template_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_template_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_template_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriTemplateFormat**](../../models/UriTemplateFormat.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md index 0c86c8d0fb8..7032a43dea3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md @@ -218,15 +218,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_allows_a_schema_which_should_validate_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](../../models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | @@ -344,15 +344,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_are_allowed_by_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_are_allowed_by_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_are_allowed_by_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesAreAllowedByDefault**](../../models/AdditionalpropertiesAreAllowedByDefault.md) | | @@ -472,15 +472,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_can_exist_by_itself_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_can_exist_by_itself_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_can_exist_by_itself_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesCanExistByItself**](../../models/AdditionalpropertiesCanExistByItself.md) | | @@ -598,15 +598,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body) | typing.Union[[request_body.application_json](#post_additionalproperties_should_not_look_in_applicators_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalpropertiesShouldNotLookInApplicators**](../../models/AdditionalpropertiesShouldNotLookInApplicators.md) | | @@ -724,15 +724,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_combined_with_anyof_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_combined_with_anyof_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_combined_with_anyof_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_combined_with_anyof_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofCombinedWithAnyofOneof**](../../models/AllofCombinedWithAnyofOneof.md) | | @@ -850,15 +850,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Allof**](../../models/Allof.md) | | @@ -976,15 +976,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_simple_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_simple_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_simple_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_simple_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofSimpleTypes**](../../models/AllofSimpleTypes.md) | | @@ -1102,15 +1102,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithBaseSchema**](../../models/AllofWithBaseSchema.md) | | @@ -1228,15 +1228,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithOneEmptySchema**](../../models/AllofWithOneEmptySchema.md) | | @@ -1354,15 +1354,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_first_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_first_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_first_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_first_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheFirstEmptySchema**](../../models/AllofWithTheFirstEmptySchema.md) | | @@ -1480,15 +1480,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_the_last_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_the_last_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_the_last_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_the_last_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTheLastEmptySchema**](../../models/AllofWithTheLastEmptySchema.md) | | @@ -1606,15 +1606,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_allof_with_two_empty_schemas_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_allof_with_two_empty_schemas_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_allof_with_two_empty_schemas_request_body.request_body) | typing.Union[[request_body.application_json](#post_allof_with_two_empty_schemas_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AllofWithTwoEmptySchemas**](../../models/AllofWithTwoEmptySchemas.md) | | @@ -1732,15 +1732,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofComplexTypes**](../../models/AnyofComplexTypes.md) | | @@ -1858,15 +1858,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Anyof**](../../models/Anyof.md) | | @@ -1984,15 +1984,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithBaseSchema**](../../models/AnyofWithBaseSchema.md) | | @@ -2110,15 +2110,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_anyof_with_one_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_anyof_with_one_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_anyof_with_one_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_anyof_with_one_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnyofWithOneEmptySchema**](../../models/AnyofWithOneEmptySchema.md) | | @@ -2238,15 +2238,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_array_type_matches_arrays_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_array_type_matches_arrays_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_array_type_matches_arrays_request_body.request_body) | typing.Union[[request_body.application_json](#post_array_type_matches_arrays_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | @@ -2364,15 +2364,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_boolean_type_matches_booleans_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_boolean_type_matches_booleans_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_boolean_type_matches_booleans_request_body.request_body) | typing.Union[[request_body.application_json](#post_boolean_type_matches_booleans_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BooleanTypeMatchesBooleans**](../../models/BooleanTypeMatchesBooleans.md) | | @@ -2490,15 +2490,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_int_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_int_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_int_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_int_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByInt**](../../models/ByInt.md) | | @@ -2616,15 +2616,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ByNumber**](../../models/ByNumber.md) | | @@ -2742,15 +2742,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_by_small_number_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_by_small_number_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_by_small_number_request_body.request_body) | typing.Union[[request_body.application_json](#post_by_small_number_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BySmallNumber**](../../models/BySmallNumber.md) | | @@ -2868,15 +2868,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_date_time_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_date_time_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_date_time_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_date_time_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**DateTimeFormat**](../../models/DateTimeFormat.md) | | @@ -2994,15 +2994,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_email_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_email_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_email_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_email_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EmailFormat**](../../models/EmailFormat.md) | | @@ -3120,15 +3120,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with0_does_not_match_false_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with0_does_not_match_false_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with0_does_not_match_false_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with0_does_not_match_false_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith0DoesNotMatchFalse**](../../models/EnumWith0DoesNotMatchFalse.md) | | @@ -3246,15 +3246,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with1_does_not_match_true_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with1_does_not_match_true_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with1_does_not_match_true_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with1_does_not_match_true_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWith1DoesNotMatchTrue**](../../models/EnumWith1DoesNotMatchTrue.md) | | @@ -3372,15 +3372,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithEscapedCharacters**](../../models/EnumWithEscapedCharacters.md) | | @@ -3498,15 +3498,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_false_does_not_match0_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_false_does_not_match0_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_false_does_not_match0_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_false_does_not_match0_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithFalseDoesNotMatch0**](../../models/EnumWithFalseDoesNotMatch0.md) | | @@ -3624,15 +3624,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enum_with_true_does_not_match1_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enum_with_true_does_not_match1_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enum_with_true_does_not_match1_request_body.request_body) | typing.Union[[request_body.application_json](#post_enum_with_true_does_not_match1_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumWithTrueDoesNotMatch1**](../../models/EnumWithTrueDoesNotMatch1.md) | | @@ -3753,15 +3753,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_enums_in_properties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_enums_in_properties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_enums_in_properties_request_body.request_body) | typing.Union[[request_body.application_json](#post_enums_in_properties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**EnumsInProperties**](../../models/EnumsInProperties.md) | | @@ -3879,15 +3879,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_forbidden_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_forbidden_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_forbidden_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_forbidden_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ForbiddenProperty**](../../models/ForbiddenProperty.md) | | @@ -4005,15 +4005,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_hostname_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_hostname_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_hostname_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_hostname_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**HostnameFormat**](../../models/HostnameFormat.md) | | @@ -4131,15 +4131,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_integer_type_matches_integers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_integer_type_matches_integers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_integer_type_matches_integers_request_body.request_body) | typing.Union[[request_body.application_json](#post_integer_type_matches_integers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**IntegerTypeMatchesIntegers**](../../models/IntegerTypeMatchesIntegers.md) | | @@ -4257,15 +4257,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](../../models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | @@ -4383,15 +4383,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_invalid_string_value_for_default_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_invalid_string_value_for_default_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_invalid_string_value_for_default_request_body.request_body) | typing.Union[[request_body.application_json](#post_invalid_string_value_for_default_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**InvalidStringValueForDefault**](../../models/InvalidStringValueForDefault.md) | | @@ -4509,15 +4509,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv4_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv4_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv4_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv4_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv4Format**](../../models/Ipv4Format.md) | | @@ -4635,15 +4635,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ipv6_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ipv6_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ipv6_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_ipv6_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Ipv6Format**](../../models/Ipv6Format.md) | | @@ -4761,15 +4761,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_json_pointer_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_json_pointer_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_json_pointer_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_json_pointer_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**JsonPointerFormat**](../../models/JsonPointerFormat.md) | | @@ -4887,15 +4887,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidation**](../../models/MaximumValidation.md) | | @@ -5013,15 +5013,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maximum_validation_with_unsigned_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maximum_validation_with_unsigned_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_maximum_validation_with_unsigned_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaximumValidationWithUnsignedInteger**](../../models/MaximumValidationWithUnsignedInteger.md) | | @@ -5139,15 +5139,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxitemsValidation**](../../models/MaxitemsValidation.md) | | @@ -5265,15 +5265,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxlengthValidation**](../../models/MaxlengthValidation.md) | | @@ -5391,15 +5391,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties0_means_the_object_is_empty_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties0_means_the_object_is_empty_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Maxproperties0MeansTheObjectIsEmpty**](../../models/Maxproperties0MeansTheObjectIsEmpty.md) | | @@ -5517,15 +5517,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_maxproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_maxproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_maxproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_maxproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MaxpropertiesValidation**](../../models/MaxpropertiesValidation.md) | | @@ -5643,15 +5643,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidation**](../../models/MinimumValidation.md) | | @@ -5769,15 +5769,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minimum_validation_with_signed_integer_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minimum_validation_with_signed_integer_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minimum_validation_with_signed_integer_request_body.request_body) | typing.Union[[request_body.application_json](#post_minimum_validation_with_signed_integer_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinimumValidationWithSignedInteger**](../../models/MinimumValidationWithSignedInteger.md) | | @@ -5895,15 +5895,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinitemsValidation**](../../models/MinitemsValidation.md) | | @@ -6021,15 +6021,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minlength_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minlength_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minlength_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minlength_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinlengthValidation**](../../models/MinlengthValidation.md) | | @@ -6147,15 +6147,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_minproperties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_minproperties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_minproperties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_minproperties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**MinpropertiesValidation**](../../models/MinpropertiesValidation.md) | | @@ -6273,15 +6273,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_allof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_allof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_allof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAllofToCheckValidationSemantics**](../../models/NestedAllofToCheckValidationSemantics.md) | | @@ -6399,15 +6399,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_anyof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_anyof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedAnyofToCheckValidationSemantics**](../../models/NestedAnyofToCheckValidationSemantics.md) | | @@ -6533,15 +6533,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedItems**](../../models/NestedItems.md) | | @@ -6659,15 +6659,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nested_oneof_to_check_validation_semantics_request_body.request_body) | typing.Union[[request_body.application_json](#post_nested_oneof_to_check_validation_semantics_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NestedOneofToCheckValidationSemantics**](../../models/NestedOneofToCheckValidationSemantics.md) | | @@ -6785,15 +6785,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_more_complex_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_more_complex_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_more_complex_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_more_complex_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NotMoreComplexSchema**](../../models/NotMoreComplexSchema.md) | | @@ -6911,15 +6911,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ModelNot**](../../models/ModelNot.md) | | @@ -7037,15 +7037,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_nul_characters_in_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_nul_characters_in_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_nul_characters_in_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_nul_characters_in_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NulCharactersInStrings**](../../models/NulCharactersInStrings.md) | | @@ -7163,15 +7163,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_null_type_matches_only_the_null_object_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_null_type_matches_only_the_null_object_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_null_type_matches_only_the_null_object_request_body.request_body) | typing.Union[[request_body.application_json](#post_null_type_matches_only_the_null_object_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NullTypeMatchesOnlyTheNullObject**](../../models/NullTypeMatchesOnlyTheNullObject.md) | | @@ -7289,15 +7289,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_number_type_matches_numbers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_number_type_matches_numbers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_number_type_matches_numbers_request_body.request_body) | typing.Union[[request_body.application_json](#post_number_type_matches_numbers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NumberTypeMatchesNumbers**](../../models/NumberTypeMatchesNumbers.md) | | @@ -7415,15 +7415,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_properties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_properties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_properties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_properties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | @@ -7541,15 +7541,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_type_matches_objects_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_type_matches_objects_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_type_matches_objects_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_type_matches_objects_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectTypeMatchesObjects**](../../models/ObjectTypeMatchesObjects.md) | | @@ -7667,15 +7667,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_complex_types_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_complex_types_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_complex_types_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_complex_types_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofComplexTypes**](../../models/OneofComplexTypes.md) | | @@ -7793,15 +7793,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Oneof**](../../models/Oneof.md) | | @@ -7919,15 +7919,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_base_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_base_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_base_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_base_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithBaseSchema**](../../models/OneofWithBaseSchema.md) | | @@ -8045,15 +8045,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_empty_schema_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_empty_schema_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_empty_schema_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_empty_schema_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithEmptySchema**](../../models/OneofWithEmptySchema.md) | | @@ -8171,15 +8171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_oneof_with_required_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_oneof_with_required_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_oneof_with_required_request_body.request_body) | typing.Union[[request_body.application_json](#post_oneof_with_required_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**OneofWithRequired**](../../models/OneofWithRequired.md) | | @@ -8297,15 +8297,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_is_not_anchored_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_is_not_anchored_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_is_not_anchored_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_is_not_anchored_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | @@ -8423,15 +8423,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternValidation**](../../models/PatternValidation.md) | | @@ -8549,15 +8549,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_properties_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_properties_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_properties_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_properties_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | @@ -8675,15 +8675,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_property_named_ref_that_is_not_a_reference_request_body.request_body) | typing.Union[[request_body.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | @@ -8803,15 +8803,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_additionalproperties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_additionalproperties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_additionalproperties_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_additionalproperties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | @@ -8929,15 +8929,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAllof**](../../models/RefInAllof.md) | | @@ -9055,15 +9055,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAnyof**](../../models/RefInAnyof.md) | | @@ -9183,15 +9183,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInItems**](../../models/RefInItems.md) | | @@ -9309,15 +9309,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInNot**](../../models/RefInNot.md) | | @@ -9435,15 +9435,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInOneof**](../../models/RefInOneof.md) | | @@ -9561,15 +9561,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInProperty**](../../models/RefInProperty.md) | | @@ -9687,15 +9687,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_default_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_default_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_default_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_default_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | @@ -9813,15 +9813,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredValidation**](../../models/RequiredValidation.md) | | @@ -9939,15 +9939,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_empty_array_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_empty_array_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_empty_array_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_empty_array_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | @@ -10065,15 +10065,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEscapedCharacters**](../../models/RequiredWithEscapedCharacters.md) | | @@ -10191,15 +10191,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_simple_enum_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_simple_enum_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_simple_enum_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_simple_enum_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**SimpleEnumValidation**](../../models/SimpleEnumValidation.md) | | @@ -10317,15 +10317,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_string_type_matches_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_string_type_matches_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_string_type_matches_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_string_type_matches_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**StringTypeMatchesStrings**](../../models/StringTypeMatchesStrings.md) | | @@ -10445,15 +10445,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body) | typing.Union[[request_body.application_json](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](../../models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | @@ -10571,15 +10571,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_false_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_false_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_false_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_false_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | @@ -10697,15 +10697,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | @@ -10823,15 +10823,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriFormat**](../../models/UriFormat.md) | | @@ -10949,15 +10949,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_reference_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_reference_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_reference_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_reference_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriReferenceFormat**](../../models/UriReferenceFormat.md) | | @@ -11075,15 +11075,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uri_template_format_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uri_template_format_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uri_template_format_request_body.request_body) | typing.Union[[request_body.application_json](#post_uri_template_format_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UriTemplateFormat**](../../models/UriTemplateFormat.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md index 704a207b6ba..cbf016cab15 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_is_not_anchored_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_is_not_anchored_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_is_not_anchored_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_is_not_anchored_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternIsNotAnchored**](../../models/PatternIsNotAnchored.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_pattern_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_pattern_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_pattern_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_pattern_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PatternValidation**](../../models/PatternValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md index 9d036c56572..7199f3c86af 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_properties_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_properties_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_properties_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_properties_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectPropertiesValidation**](../../models/ObjectPropertiesValidation.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_properties_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_properties_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_properties_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_properties_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertiesWithEscapedCharacters**](../../models/PropertiesWithEscapedCharacters.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md index bf1cdcda6f7..ddcb5b3b647 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md @@ -57,15 +57,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_property_named_ref_that_is_not_a_reference_request_body.request_body) | typing.Union[[request_body.application_json](#post_property_named_ref_that_is_not_a_reference_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**PropertyNamedRefThatIsNotAReference**](../../models/PropertyNamedRefThatIsNotAReference.md) | | @@ -185,15 +185,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_additionalproperties_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_additionalproperties_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_additionalproperties_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_additionalproperties_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAdditionalproperties**](../../models/RefInAdditionalproperties.md) | | @@ -311,15 +311,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_allof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_allof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_allof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_allof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAllof**](../../models/RefInAllof.md) | | @@ -437,15 +437,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_anyof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_anyof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_anyof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_anyof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInAnyof**](../../models/RefInAnyof.md) | | @@ -565,15 +565,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_items_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_items_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_items_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_items_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInItems**](../../models/RefInItems.md) | | @@ -691,15 +691,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_not_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_not_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_not_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_not_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInNot**](../../models/RefInNot.md) | | @@ -817,15 +817,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_oneof_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_oneof_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_oneof_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_oneof_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInOneof**](../../models/RefInOneof.md) | | @@ -943,15 +943,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_ref_in_property_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_ref_in_property_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_ref_in_property_request_body.request_body) | typing.Union[[request_body.application_json](#post_ref_in_property_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RefInProperty**](../../models/RefInProperty.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md index 47eff4b8c19..447bb499c14 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md @@ -49,15 +49,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_default_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_default_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_default_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_default_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredDefaultValidation**](../../models/RequiredDefaultValidation.md) | | @@ -175,15 +175,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredValidation**](../../models/RequiredValidation.md) | | @@ -301,15 +301,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_empty_array_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_empty_array_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_empty_array_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_empty_array_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEmptyArray**](../../models/RequiredWithEmptyArray.md) | | @@ -427,15 +427,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_required_with_escaped_characters_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_required_with_escaped_characters_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_required_with_escaped_characters_request_body.request_body) | typing.Union[[request_body.application_json](#post_required_with_escaped_characters_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**RequiredWithEscapedCharacters**](../../models/RequiredWithEscapedCharacters.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md index 011eea04e96..b6ae3ce197e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md @@ -57,15 +57,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_array_type_matches_arrays_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_array_type_matches_arrays_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_array_type_matches_arrays_request_body.request_body) | typing.Union[[request_body.application_json](#post_array_type_matches_arrays_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ArrayTypeMatchesArrays**](../../models/ArrayTypeMatchesArrays.md) | | @@ -183,15 +183,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_boolean_type_matches_booleans_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_boolean_type_matches_booleans_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_boolean_type_matches_booleans_request_body.request_body) | typing.Union[[request_body.application_json](#post_boolean_type_matches_booleans_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**BooleanTypeMatchesBooleans**](../../models/BooleanTypeMatchesBooleans.md) | | @@ -309,15 +309,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_integer_type_matches_integers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_integer_type_matches_integers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_integer_type_matches_integers_request_body.request_body) | typing.Union[[request_body.application_json](#post_integer_type_matches_integers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**IntegerTypeMatchesIntegers**](../../models/IntegerTypeMatchesIntegers.md) | | @@ -435,15 +435,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_null_type_matches_only_the_null_object_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_null_type_matches_only_the_null_object_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_null_type_matches_only_the_null_object_request_body.request_body) | typing.Union[[request_body.application_json](#post_null_type_matches_only_the_null_object_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NullTypeMatchesOnlyTheNullObject**](../../models/NullTypeMatchesOnlyTheNullObject.md) | | @@ -561,15 +561,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_number_type_matches_numbers_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_number_type_matches_numbers_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_number_type_matches_numbers_request_body.request_body) | typing.Union[[request_body.application_json](#post_number_type_matches_numbers_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NumberTypeMatchesNumbers**](../../models/NumberTypeMatchesNumbers.md) | | @@ -687,15 +687,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_object_type_matches_objects_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_object_type_matches_objects_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_object_type_matches_objects_request_body.request_body) | typing.Union[[request_body.application_json](#post_object_type_matches_objects_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectTypeMatchesObjects**](../../models/ObjectTypeMatchesObjects.md) | | @@ -813,15 +813,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_string_type_matches_strings_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_string_type_matches_strings_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_string_type_matches_strings_request_body.request_body) | typing.Union[[request_body.application_json](#post_string_type_matches_strings_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**StringTypeMatchesStrings**](../../models/StringTypeMatchesStrings.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md index 6eb06bd8079..033ca75fea1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md @@ -45,15 +45,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_false_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_false_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_false_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_false_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsFalseValidation**](../../models/UniqueitemsFalseValidation.md) | | @@ -171,15 +171,15 @@ with unit_test_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_uniqueitems_validation_request_body.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_uniqueitems_validation_request_body.RequestBody.Schemas.application_json)] | required | +[body](#post_uniqueitems_validation_request_body.request_body) | typing.Union[[request_body.application_json](#post_uniqueitems_validation_request_body.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**UniqueitemsValidation**](../../models/UniqueitemsValidation.md) | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py index ad74ec903f7..2953a881b5f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py @@ -44,7 +44,7 @@ def test_no_additional_properties_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -82,7 +82,7 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py index 7189fc2fe0c..addc8fe0afe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py @@ -48,7 +48,7 @@ def test_additional_properties_are_allowed_passes(self): True, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py index ac53aabc5ac..5e2654890a1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py @@ -45,7 +45,7 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -61,7 +61,7 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py index e38f12a3739..7e796eae993 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py @@ -47,7 +47,7 @@ def test_properties_defined_in_allof_are_not_examined_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -65,7 +65,7 @@ def test_valid_test_case_passes(self): True, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py index dc3ce0eaa17..1c2245e98a5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py @@ -42,7 +42,7 @@ def test_allof_true_anyof_false_oneof_false_fails(self): 2 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_allof_false_anyof_false_oneof_true_fails(self): 5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -70,7 +70,7 @@ def test_allof_false_anyof_true_oneof_true_fails(self): 15 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_allof_true_anyof_true_oneof_false_fails(self): 6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -97,7 +97,7 @@ def test_allof_true_anyof_true_oneof_true_passes(self): payload = ( 30 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -128,7 +128,7 @@ def test_allof_true_anyof_false_oneof_true_fails(self): 10 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -142,7 +142,7 @@ def test_allof_false_anyof_true_oneof_false_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -156,7 +156,7 @@ def test_allof_false_anyof_false_oneof_false_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py index 470f2b91d12..844df9536a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py @@ -46,7 +46,7 @@ def test_allof_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -80,7 +80,7 @@ def test_mismatch_first_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -97,7 +97,7 @@ def test_mismatch_second_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -116,7 +116,7 @@ def test_wrong_type_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py index d3e5d6942d1..0c7b80d9231 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py @@ -41,7 +41,7 @@ def test_valid_passes(self): payload = ( 25 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_mismatch_one_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py index bd973cba638..f85d5fb4b16 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py @@ -48,7 +48,7 @@ def test_valid_passes(self): None, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_mismatch_first_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -103,7 +103,7 @@ def test_mismatch_base_schema_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -120,7 +120,7 @@ def test_mismatch_both_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -139,7 +139,7 @@ def test_mismatch_second_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py index 5bd16a4a057..6371981408a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py @@ -41,7 +41,7 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py index 90e74923916..818026898f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py @@ -42,7 +42,7 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py index f68dc101f6e..2570346598e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py @@ -42,7 +42,7 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py index 131a0c613d8..32ffcc77175 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py @@ -41,7 +41,7 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py index 259be224575..4db379859a6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py @@ -44,7 +44,7 @@ def test_second_anyof_valid_complex_passes(self): "baz", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -80,7 +80,7 @@ def test_neither_anyof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -98,7 +98,7 @@ def test_both_anyof_valid_complex_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -131,7 +131,7 @@ def test_first_anyof_valid_complex_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py index 77955591754..ddfa2c86034 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py @@ -41,7 +41,7 @@ def test_second_anyof_valid_passes(self): payload = ( 2.5 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_neither_anyof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_both_anyof_valid_passes(self): payload = ( 3 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_first_anyof_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py index 24c03599c1a..8becdef8fdb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py @@ -41,7 +41,7 @@ def test_one_anyof_valid_passes(self): payload = ( "foobar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_both_anyof_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -86,7 +86,7 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py index ba35a8aa949..2d6bfc67064 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py @@ -41,7 +41,7 @@ def test_string_is_valid_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_number_is_valid_passes(self): payload = ( 123 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py index f78a6aa0fd7..d0af4d62392 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py @@ -42,7 +42,7 @@ def test_a_float_is_not_an_array_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_a_boolean_is_not_an_array_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -70,7 +70,7 @@ def test_null_is_not_an_array_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_an_object_is_not_an_array_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_a_string_is_not_an_array_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -113,7 +113,7 @@ def test_an_array_is_an_array_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -144,7 +144,7 @@ def test_an_integer_is_not_an_array_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py index 56f4ba8aeaf..372391ceec2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py @@ -42,7 +42,7 @@ def test_an_empty_string_is_not_a_boolean_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_a_float_is_not_a_boolean_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -70,7 +70,7 @@ def test_null_is_not_a_boolean_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_zero_is_not_a_boolean_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_an_array_is_not_a_boolean_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -113,7 +113,7 @@ def test_a_string_is_not_a_boolean_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -126,7 +126,7 @@ def test_false_is_a_boolean_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -157,7 +157,7 @@ def test_an_integer_is_not_a_boolean_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -170,7 +170,7 @@ def test_true_is_a_boolean_passes(self): payload = ( True ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -202,7 +202,7 @@ def test_an_object_is_not_a_boolean_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py index 08dd4ff8f6e..bbaa7049bfa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py @@ -42,7 +42,7 @@ def test_int_by_int_fail_fails(self): 7 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_int_by_int_passes(self): payload = ( 10 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_ignores_non_numbers_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py index 0d85ce6a66c..b5fb1978a48 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py @@ -41,7 +41,7 @@ def test_45_is_multiple_of15_passes(self): payload = ( 4.5 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_35_is_not_multiple_of15_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_zero_is_multiple_of_anything_passes(self): payload = ( 0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py index c1dd83bc858..22fa1a595f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py @@ -42,7 +42,7 @@ def test_000751_is_not_multiple_of00001_fails(self): 0.00751 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_00075_is_multiple_of00001_passes(self): payload = ( 0.0075 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py index 9fcaa87edb3..af22016d560 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py index 7879248ff5f..9db1fa8a19f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py index c6cad639b0a..f4e6c929da8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py @@ -41,7 +41,7 @@ def test_integer_zero_is_valid_passes(self): payload = ( 0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_float_zero_is_valid_passes(self): payload = ( 0.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_false_is_invalid_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py index e6ad4a0b7ad..abc6c0312cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py @@ -42,7 +42,7 @@ def test_true_is_invalid_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_integer_one_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_float_one_is_valid_passes(self): payload = ( 1.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py index ec1d32c744a..f3477244dab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py @@ -41,7 +41,7 @@ def test_member2_is_valid_passes(self): payload = ( "foo\rbar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_member1_is_valid_passes(self): payload = ( "foo\nbar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_another_string_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py index 0193bd9d8ec..ee90582ed62 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py @@ -41,7 +41,7 @@ def test_false_is_valid_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_float_zero_is_invalid_fails(self): 0.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -86,7 +86,7 @@ def test_integer_zero_is_invalid_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py index cfbde927ae4..d315be52a6d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py @@ -42,7 +42,7 @@ def test_float_one_is_invalid_fails(self): 1.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_true_is_valid_passes(self): payload = ( True ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -86,7 +86,7 @@ def test_integer_one_is_invalid_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py index 9bd9743a411..0abeeb147b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py @@ -44,7 +44,7 @@ def test_missing_optional_property_is_valid_passes(self): "bar", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -80,7 +80,7 @@ def test_wrong_foo_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -98,7 +98,7 @@ def test_both_properties_are_valid_passes(self): "bar", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -134,7 +134,7 @@ def test_wrong_bar_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -149,7 +149,7 @@ def test_missing_all_properties_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -166,7 +166,7 @@ def test_missing_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py index 96607673062..e40d1c665b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py @@ -47,7 +47,7 @@ def test_property_present_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -65,7 +65,7 @@ def test_property_absent_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py index 0e06dcab928..1740394b4f1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py index 5425cbed897..12ccf62e7ef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py @@ -43,7 +43,7 @@ def test_an_object_is_not_an_integer_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -57,7 +57,7 @@ def test_a_string_is_not_an_integer_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_null_is_not_an_integer_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): payload = ( 1.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_a_float_is_not_an_integer_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -129,7 +129,7 @@ def test_a_boolean_is_not_an_integer_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -142,7 +142,7 @@ def test_an_integer_is_an_integer_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -173,7 +173,7 @@ def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -188,7 +188,7 @@ def test_an_array_is_not_an_integer_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py index fb51c877c43..e9055591d28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py @@ -42,7 +42,7 @@ def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fa 1.0E308 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_valid_integer_with_multipleof_float_passes(self): payload = ( 123456789 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py index 8919018b2cb..10c3ad84fdf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py @@ -44,7 +44,7 @@ def test_valid_when_property_is_specified_passes(self): "good", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -75,7 +75,7 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py index a907801620c..6e0d64bfa2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py index 70fc9423063..949b3e87fee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py index 098cce34873..41dc22d225c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py index 3f5537eb1cd..3303a47573e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py @@ -41,7 +41,7 @@ def test_below_the_maximum_is_valid_passes(self): payload = ( 2.6 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_boundary_point_is_valid_passes(self): payload = ( 3.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_above_the_maximum_is_invalid_fails(self): 3.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py index 00a704b49bd..1919ee8e579 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py @@ -41,7 +41,7 @@ def test_below_the_maximum_is_invalid_passes(self): payload = ( 299.97 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_above_the_maximum_is_invalid_fails(self): 300.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_boundary_point_integer_is_valid_passes(self): payload = ( 300 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_boundary_point_float_is_valid_passes(self): payload = ( 300.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py index 83efc6dca0b..190786b34fc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py @@ -46,7 +46,7 @@ def test_too_long_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -59,7 +59,7 @@ def test_ignores_non_arrays_passes(self): payload = ( "foobar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -91,7 +91,7 @@ def test_shorter_is_valid_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -124,7 +124,7 @@ def test_exact_length_is_valid_passes(self): 2, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py index 5f35a76dffd..9e7fa12c7c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_too_long_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_ignores_non_strings_passes(self): payload = ( 100 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_shorter_is_valid_passes(self): payload = ( "f" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): payload = ( "💩💩" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -145,7 +145,7 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py index f975c25ed07..d7ebb601f88 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py @@ -42,7 +42,7 @@ def test_no_properties_is_valid_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -76,7 +76,7 @@ def test_one_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py index 6dbcd8d21a2..6031533b8c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py @@ -49,7 +49,7 @@ def test_too_long_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -66,7 +66,7 @@ def test_ignores_arrays_passes(self): 3, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -96,7 +96,7 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -126,7 +126,7 @@ def test_ignores_strings_passes(self): payload = ( "foobar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -159,7 +159,7 @@ def test_shorter_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -194,7 +194,7 @@ def test_exact_length_is_valid_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py index 4a38f9ac343..9c54fc56ebd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py @@ -41,7 +41,7 @@ def test_boundary_point_is_valid_passes(self): payload = ( 1.1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_below_the_minimum_is_invalid_fails(self): 0.6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_above_the_minimum_is_valid_passes(self): payload = ( 2.6 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py index 1c0c51cb3ea..0b66fd1c883 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py @@ -41,7 +41,7 @@ def test_boundary_point_is_valid_passes(self): payload = ( -2 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_positive_above_the_minimum_is_valid_passes(self): payload = ( 0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_int_below_the_minimum_is_invalid_fails(self): -3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -116,7 +116,7 @@ def test_float_below_the_minimum_is_invalid_fails(self): -2.0001 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -129,7 +129,7 @@ def test_boundary_point_with_float_is_valid_passes(self): payload = ( -2.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -159,7 +159,7 @@ def test_negative_above_the_minimum_is_valid_passes(self): payload = ( -1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -189,7 +189,7 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py index 7588cfe89d6..3442023951f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py @@ -43,7 +43,7 @@ def test_too_short_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_ignores_non_arrays_passes(self): payload = ( "" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -89,7 +89,7 @@ def test_longer_is_valid_passes(self): 2, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -121,7 +121,7 @@ def test_exact_length_is_valid_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py index 079e2d765de..9e7f2a306fe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_too_short_is_invalid_fails(self): "f" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): "💩" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -69,7 +69,7 @@ def test_longer_is_valid_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_ignores_non_strings_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -129,7 +129,7 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py index 3781d2032c8..f777f6ae69d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -104,7 +104,7 @@ def test_too_short_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -117,7 +117,7 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -152,7 +152,7 @@ def test_longer_is_valid_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -185,7 +185,7 @@ def test_exact_length_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py index e68773d6a24..e0cb87f8304 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py @@ -42,7 +42,7 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py index ff0db76919e..b31a20a53e4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py @@ -42,7 +42,7 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py index 8be3d9cc4a6..135f8213328 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py @@ -70,7 +70,7 @@ def test_valid_nested_array_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -130,7 +130,7 @@ def test_nested_array_with_invalid_type_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -167,7 +167,7 @@ def test_not_deep_enough_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py index 669faf36fb3..d5bd55fa779 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py @@ -42,7 +42,7 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py index 8585b91a525..02f26b50e74 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py @@ -44,7 +44,7 @@ def test_other_match_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_mismatch_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -91,7 +91,7 @@ def test_match_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py index e502a02e359..326178bcebb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py @@ -41,7 +41,7 @@ def test_allowed_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_disallowed_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py index 018514f2bbe..de7dd20e750 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py @@ -41,7 +41,7 @@ def test_match_string_with_nul_passes(self): payload = ( "hello\x00there" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_do_not_match_string_lacking_nul_fails(self): "hellothere" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py index 1786fb06066..9915024ac4a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py @@ -42,7 +42,7 @@ def test_a_float_is_not_null_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -57,7 +57,7 @@ def test_an_object_is_not_null_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_false_is_not_null_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_an_integer_is_not_null_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_true_is_not_null_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -113,7 +113,7 @@ def test_zero_is_not_null_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -127,7 +127,7 @@ def test_an_empty_string_is_not_null_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -140,7 +140,7 @@ def test_null_is_null_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -172,7 +172,7 @@ def test_an_array_is_not_null_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -186,7 +186,7 @@ def test_a_string_is_not_null_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py index 4a9bf790644..f2ee7274462 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py @@ -43,7 +43,7 @@ def test_an_array_is_not_a_number_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -57,7 +57,7 @@ def test_null_is_not_a_number_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_an_object_is_not_a_number_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -86,7 +86,7 @@ def test_a_boolean_is_not_a_number_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_a_float_is_a_number_passes(self): payload = ( 1.1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -130,7 +130,7 @@ def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -144,7 +144,7 @@ def test_a_string_is_not_a_number_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -157,7 +157,7 @@ def test_an_integer_is_a_number_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -187,7 +187,7 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel payload = ( 1.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py index 08748ca6f2b..e0afae356c6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -109,7 +109,7 @@ def test_one_property_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -127,7 +127,7 @@ def test_both_properties_present_and_valid_is_valid_passes(self): "baz", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -161,7 +161,7 @@ def test_doesn_t_invalidate_other_properties_passes(self): ], } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -199,7 +199,7 @@ def test_both_properties_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py index 4a6cc96b8b0..171d66b0b46 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py @@ -42,7 +42,7 @@ def test_a_float_is_not_an_object_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_null_is_not_an_object_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -71,7 +71,7 @@ def test_an_array_is_not_an_object_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_an_object_is_an_object_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -116,7 +116,7 @@ def test_a_string_is_not_an_object_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -130,7 +130,7 @@ def test_an_integer_is_not_an_object_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -144,7 +144,7 @@ def test_a_boolean_is_not_an_object_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py index a0a9e390010..195d452ff15 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py @@ -44,7 +44,7 @@ def test_first_oneof_valid_complex_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -80,7 +80,7 @@ def test_neither_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -99,7 +99,7 @@ def test_both_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -115,7 +115,7 @@ def test_second_oneof_valid_complex_passes(self): "baz", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py index afb1d278735..c05112781e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py @@ -41,7 +41,7 @@ def test_second_oneof_valid_passes(self): payload = ( 2.5 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_both_oneof_valid_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_first_oneof_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -116,7 +116,7 @@ def test_neither_oneof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py index 821ee84b34c..ce978513996 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py @@ -42,7 +42,7 @@ def test_both_oneof_valid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -56,7 +56,7 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -69,7 +69,7 @@ def test_one_oneof_valid_passes(self): payload = ( "foobar" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py index aada787b71b..8f1a5915228 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py @@ -42,7 +42,7 @@ def test_both_valid_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_one_valid_valid_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py index fbb5fdf3d75..50d3b0febb9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py @@ -49,7 +49,7 @@ def test_both_valid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -66,7 +66,7 @@ def test_both_invalid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_first_valid_valid_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -119,7 +119,7 @@ def test_second_valid_valid_passes(self): 3, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py index 53cff0084b6..72dab2760b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py @@ -41,7 +41,7 @@ def test_matches_a_substring_passes(self): payload = ( "xxaayy" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py index 0964aabd571..faf41cc7b0f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -73,7 +73,7 @@ def test_ignores_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -103,7 +103,7 @@ def test_ignores_null_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -133,7 +133,7 @@ def test_ignores_floats_passes(self): payload = ( 1.0 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -164,7 +164,7 @@ def test_a_non_matching_pattern_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -177,7 +177,7 @@ def test_ignores_booleans_passes(self): payload = ( True ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -207,7 +207,7 @@ def test_a_matching_pattern_is_valid_passes(self): payload = ( "aaa" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -237,7 +237,7 @@ def test_ignores_integers_passes(self): payload = ( 123 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py index 7cea775bbee..6daed84e25d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py @@ -54,7 +54,7 @@ def test_object_with_all_numbers_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -98,7 +98,7 @@ def test_object_with_strings_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py index 72cfd4ef59a..28ece78b000 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py @@ -44,7 +44,7 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py index cd677e9cb18..79b8e9fa8b6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py @@ -47,7 +47,7 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py index b03e5d18691..ba655509d26 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py @@ -44,7 +44,7 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py index 5b8fb1ed591..e383c585ab0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py @@ -44,7 +44,7 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py index 15b78bf86b4..80312bd8615 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py @@ -46,7 +46,7 @@ def test_property_named_ref_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -82,7 +82,7 @@ def test_property_named_ref_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py index bd4c35412f6..dfe2ffb9c39 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py @@ -44,7 +44,7 @@ def test_property_named_ref_valid_passes(self): 2, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py index 9212b716292..1742acb9bd5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py @@ -44,7 +44,7 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -78,7 +78,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py index 5a2f5f62273..6a942f23666 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py @@ -47,7 +47,7 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -84,7 +84,7 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py index 098e021e57a..1d34169b4d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_not_required_by_default_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py index 4fa39334d1e..25f77f24ed4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -75,7 +75,7 @@ def test_present_required_property_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -105,7 +105,7 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -135,7 +135,7 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -169,7 +169,7 @@ def test_non_present_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py index e9ded363e78..a59736649c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py @@ -42,7 +42,7 @@ def test_property_not_required_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py index 719d03bd2b8..a1e8074793c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py @@ -47,7 +47,7 @@ def test_object_with_some_properties_missing_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -73,7 +73,7 @@ def test_object_with_all_properties_present_is_valid_passes(self): 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py index 4b06cd2642e..6c7024f1453 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py @@ -42,7 +42,7 @@ def test_something_else_is_invalid_fails(self): 4 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_one_of_the_enum_is_valid_passes(self): payload = ( 1 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py index cdfe47c3cb8..39d0f95e46f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py @@ -42,7 +42,7 @@ def test_1_is_not_a_string_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -55,7 +55,7 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): payload = ( "1" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -85,7 +85,7 @@ def test_an_empty_string_is_still_a_string_passes(self): payload = ( "" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -116,7 +116,7 @@ def test_a_float_is_not_a_string_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -131,7 +131,7 @@ def test_an_object_is_not_a_string_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -146,7 +146,7 @@ def test_an_array_is_not_a_string_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -160,7 +160,7 @@ def test_a_boolean_is_not_a_string_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -174,7 +174,7 @@ def test_null_is_not_a_string_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -187,7 +187,7 @@ def test_a_string_is_a_string_passes(self): payload = ( "foo" ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py index 8072150e5d1..99fc263b7c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py @@ -42,7 +42,7 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -75,7 +75,7 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se 1, } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -109,7 +109,7 @@ def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(sel } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py index 4b64f9b5e68..1fcf9a7a376 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py @@ -44,7 +44,7 @@ def test_non_unique_array_of_integers_is_valid_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -83,7 +83,7 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -134,7 +134,7 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -173,7 +173,7 @@ def test_non_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -206,7 +206,7 @@ def test_1_and_true_are_unique_passes(self): True, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -239,7 +239,7 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -276,7 +276,7 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -310,7 +310,7 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -343,7 +343,7 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -394,7 +394,7 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -427,7 +427,7 @@ def test_0_and_false_are_unique_passes(self): False, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -464,7 +464,7 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -497,7 +497,7 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -538,7 +538,7 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -577,7 +577,7 @@ def test_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py index be7e6cab0a4..a59892b632f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py @@ -50,7 +50,7 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -89,7 +89,7 @@ def test_a_true_and_a1_are_unique_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -131,7 +131,7 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -157,7 +157,7 @@ def test_nested0_and_false_are_unique_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -196,7 +196,7 @@ def test_a_false_and_a0_are_unique_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -231,7 +231,7 @@ def test_numbers_are_unique_if_mathematically_unequal_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -247,7 +247,7 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -284,7 +284,7 @@ def test_0_and_false_are_unique_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -321,7 +321,7 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -373,7 +373,7 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -391,7 +391,7 @@ def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -407,7 +407,7 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -451,7 +451,7 @@ def test_objects_are_non_unique_despite_key_order_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -468,7 +468,7 @@ def test_unique_array_of_strings_is_valid_passes(self): "baz", ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -505,7 +505,7 @@ def test_1_and_true_are_unique_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -548,7 +548,7 @@ def test_different_objects_are_unique_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -581,7 +581,7 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -622,7 +622,7 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -645,7 +645,7 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -679,7 +679,7 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -717,7 +717,7 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -735,7 +735,7 @@ def test_non_unique_array_of_strings_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -761,7 +761,7 @@ def test_nested1_and_true_are_unique_passes(self): ], ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -801,7 +801,7 @@ def test_unique_heterogeneous_types_are_valid_passes(self): "{}", ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -835,7 +835,7 @@ def test_non_unique_array_of_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py index f9f2c002947..95582779708 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py index 22574fbab71..eecc8ce8bd5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py index c3a5d713fc4..30b43b163e4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py @@ -42,7 +42,7 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -72,7 +72,7 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -102,7 +102,7 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -132,7 +132,7 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -163,7 +163,7 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) @@ -193,7 +193,7 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.RequestBody.Schemas.application_json.from_openapi_data_oapg( + body = post.request_body.application_json.from_openapi_data_oapg( payload, _configuration=self._configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py index 37a60571dd9..5aed0224ec7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi index 4df9200d050..54581795def 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesAllowsASchemaWhichShouldValidate - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseAp def post_additionalproperties_allows_a_schema_which_should_validate_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body.py new file mode 100644 index 00000000000..77cb71d334b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate + + +application_json = AdditionalpropertiesAllowsASchemaWhichShouldValidate + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py index 86cc478b99b..518202d323d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesAreAllowedByDefault - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_additionalproperties_are_allowed_by_default_request_body_oapg( @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_additionalproperties_are_allowed_by_default_request_body_oapg( @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_additionalproperties_are_allowed_by_default_request_body_oapg( @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_additionalproperties_are_allowed_by_default_request_body_oapg( def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_additionalproperties_are_allowed_by_default_request_body( @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_additionalproperties_are_allowed_by_default_request_body( @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_additionalproperties_are_allowed_by_default_request_body( @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_additionalproperties_are_allowed_by_default_request_body( def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi index c3e1dfde555..f33bc05117d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesAreAllowedByDefault - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_additionalproperties_are_allowed_by_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): @typing.overload def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(BaseApi): def post_additionalproperties_are_allowed_by_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body.py new file mode 100644 index 00000000000..453b03ab347 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault + + +application_json = AdditionalpropertiesAreAllowedByDefault + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py index 060201d75d1..73515eb7c3c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesCanExistByItself - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_additionalproperties_can_exist_by_itself_request_body_oapg( @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_additionalproperties_can_exist_by_itself_request_body_oapg( @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_additionalproperties_can_exist_by_itself_request_body_oapg( @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_additionalproperties_can_exist_by_itself_request_body_oapg( def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_additionalproperties_can_exist_by_itself_request_body( @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_additionalproperties_can_exist_by_itself_request_body( @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_additionalproperties_can_exist_by_itself_request_body( @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_additionalproperties_can_exist_by_itself_request_body( def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi index 6119340a9a2..1927ac249f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesCanExistByItself - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_additionalproperties_can_exist_by_itself_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): @typing.overload def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAdditionalpropertiesCanExistByItselfRequestBody(BaseApi): def post_additionalproperties_can_exist_by_itself_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body.py new file mode 100644 index 00000000000..f7161a3573c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself + + +application_json = AdditionalpropertiesCanExistByItself + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py index 1efb6033a67..45e407f5535 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesShouldNotLookInApplicators - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_additionalproperties_should_not_look_in_applicators_request_body( @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_additionalproperties_should_not_look_in_applicators_request_body( @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_additionalproperties_should_not_look_in_applicators_request_body( @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_additionalproperties_should_not_look_in_applicators_request_body( def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi index a00d91a8d91..801357c8f13 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AdditionalpropertiesShouldNotLookInApplicators - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_additionalproperties_should_not_look_in_applicators_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): @typing.overload def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(BaseApi): def post_additionalproperties_should_not_look_in_applicators_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body.py new file mode 100644 index 00000000000..5242331286f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators + + +application_json = AdditionalpropertiesShouldNotLookInApplicators + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py index 2bd936a13d7..0b01bc0b426 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofCombinedWithAnyofOneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_combined_with_anyof_oneof_request_body_oapg( @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_combined_with_anyof_oneof_request_body_oapg( @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_combined_with_anyof_oneof_request_body_oapg( @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_combined_with_anyof_oneof_request_body_oapg( def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_combined_with_anyof_oneof_request_body( @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_combined_with_anyof_oneof_request_body( @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_combined_with_anyof_oneof_request_body( @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_combined_with_anyof_oneof_request_body( def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi index f36e2d42a56..cf9a9e07bfe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofCombinedWithAnyofOneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_combined_with_anyof_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofCombinedWithAnyofOneofRequestBody(BaseApi): def post_allof_combined_with_anyof_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body.py new file mode 100644 index 00000000000..48233ccd206 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof + + +application_json = AllofCombinedWithAnyofOneof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py index f763ebc371c..0b21fb5d707 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Allof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_request_body_oapg( @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_request_body_oapg( @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_request_body_oapg( @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_request_body_oapg( def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofRequestBody(BaseApi): @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_request_body( @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_request_body( @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_request_body( @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_request_body( def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi index 3e324741beb..08a3adf81d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof import Allof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Allof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofRequestBody(BaseApi): @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofRequestBody(BaseApi): @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofRequestBody(BaseApi): @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofRequestBody(BaseApi): @typing.overload def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofRequestBody(BaseApi): def post_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body.py new file mode 100644 index 00000000000..8319bac05bf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof import Allof + + +application_json = Allof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py index d5da30df661..d19723e9590 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofSimpleTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_simple_types_request_body_oapg( @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_simple_types_request_body_oapg( @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_simple_types_request_body_oapg( @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_simple_types_request_body_oapg( def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_simple_types_request_body( @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_simple_types_request_body( @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_simple_types_request_body( @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_simple_types_request_body( def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi index 109651dd09b..6c1a739f3ab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_simple_types import AllofSimpleTypes from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofSimpleTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_simple_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): @typing.overload def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofSimpleTypesRequestBody(BaseApi): def post_allof_simple_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body.py new file mode 100644 index 00000000000..36fa1b91c87 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_simple_types import AllofSimpleTypes + + +application_json = AllofSimpleTypes + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py index 229276a93e0..dbf91106a4c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_with_base_schema_request_body_oapg( @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_with_base_schema_request_body_oapg( @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_with_base_schema_request_body_oapg( @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_with_base_schema_request_body_oapg( def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_with_base_schema_request_body( @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_with_base_schema_request_body( @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_with_base_schema_request_body( @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_with_base_schema_request_body( def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi index 5966d14e457..7f3f729a7d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofWithBaseSchemaRequestBody(BaseApi): def post_allof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..b89cce3a860 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema + + +application_json = AllofWithBaseSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py index c88c42fb66e..5eb1e97647f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofWithOneEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_with_one_empty_schema_request_body_oapg( def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_with_one_empty_schema_request_body( @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_with_one_empty_schema_request_body( @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_with_one_empty_schema_request_body( @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_with_one_empty_schema_request_body( def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi index e34082ec2e9..528f5003525 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofWithOneEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofWithOneEmptySchemaRequestBody(BaseApi): def post_allof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..f8789eed68d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema + + +application_json = AllofWithOneEmptySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py index 6efe4cb7318..f2598642132 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofWithTheFirstEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_with_the_first_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_with_the_first_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_with_the_first_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_with_the_first_empty_schema_request_body_oapg( def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_with_the_first_empty_schema_request_body( @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_with_the_first_empty_schema_request_body( @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_with_the_first_empty_schema_request_body( @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_with_the_first_empty_schema_request_body( def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi index b21544a67ae..75baa79e003 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofWithTheFirstEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_with_the_first_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofWithTheFirstEmptySchemaRequestBody(BaseApi): def post_allof_with_the_first_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..26756459d4d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema + + +application_json = AllofWithTheFirstEmptySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py index cef8ff6fbb4..89fe18c719f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofWithTheLastEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_with_the_last_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_with_the_last_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_with_the_last_empty_schema_request_body_oapg( @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_with_the_last_empty_schema_request_body_oapg( def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_with_the_last_empty_schema_request_body( @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_with_the_last_empty_schema_request_body( @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_with_the_last_empty_schema_request_body( @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_with_the_last_empty_schema_request_body( def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi index 98a2a02a1ce..2c1a6205695 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofWithTheLastEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_with_the_last_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofWithTheLastEmptySchemaRequestBody(BaseApi): def post_allof_with_the_last_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..81c26cf7271 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema + + +application_json = AllofWithTheLastEmptySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py index 36cb313d7fc..70ccf9ce629 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AllofWithTwoEmptySchemas - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_allof_with_two_empty_schemas_request_body_oapg( @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_allof_with_two_empty_schemas_request_body_oapg( @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_allof_with_two_empty_schemas_request_body_oapg( @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_allof_with_two_empty_schemas_request_body_oapg( def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_allof_with_two_empty_schemas_request_body( @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_allof_with_two_empty_schemas_request_body( @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_allof_with_two_empty_schemas_request_body( @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_allof_with_two_empty_schemas_request_body( def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi index baf17e20546..7b17a310099 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AllofWithTwoEmptySchemas - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_allof_with_two_empty_schemas_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAllofWithTwoEmptySchemasRequestBody(BaseApi): def post_allof_with_two_empty_schemas_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body.py new file mode 100644 index 00000000000..0acb07a449c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas + + +application_json = AllofWithTwoEmptySchemas + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py index aabb1d22935..3eaad49e114 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AnyofComplexTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_anyof_complex_types_request_body_oapg( @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_anyof_complex_types_request_body_oapg( @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_anyof_complex_types_request_body_oapg( @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_anyof_complex_types_request_body_oapg( def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_anyof_complex_types_request_body( @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_anyof_complex_types_request_body( @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_anyof_complex_types_request_body( @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_anyof_complex_types_request_body( def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi index 106e8af5f48..cd74edaab22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.anyof_complex_types import AnyofComplexTypes from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AnyofComplexTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_anyof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): @typing.overload def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAnyofComplexTypesRequestBody(BaseApi): def post_anyof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body.py new file mode 100644 index 00000000000..af9f45f32c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes + + +application_json = AnyofComplexTypes + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py index dab283e8b17..8878f969a85 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Anyof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_anyof_request_body_oapg( @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_anyof_request_body_oapg( @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_anyof_request_body_oapg( @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_anyof_request_body_oapg( def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAnyofRequestBody(BaseApi): @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_anyof_request_body( @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_anyof_request_body( @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_anyof_request_body( @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_anyof_request_body( def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi index 10b760da6e6..e02d8b1e2a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.anyof import Anyof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Anyof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAnyofRequestBody(BaseApi): @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAnyofRequestBody(BaseApi): @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAnyofRequestBody(BaseApi): @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAnyofRequestBody(BaseApi): @typing.overload def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAnyofRequestBody(BaseApi): def post_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body.py new file mode 100644 index 00000000000..20a63522a31 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.anyof import Anyof + + +application_json = Anyof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py index 4d0ae8c2e0a..2cee0655009 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AnyofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_anyof_with_base_schema_request_body_oapg( @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_anyof_with_base_schema_request_body_oapg( @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_anyof_with_base_schema_request_body_oapg( @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_anyof_with_base_schema_request_body_oapg( def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_anyof_with_base_schema_request_body( @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_anyof_with_base_schema_request_body( @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_anyof_with_base_schema_request_body( @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_anyof_with_base_schema_request_body( def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi index 7e7cf205a91..2dd5f923e2a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AnyofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_anyof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAnyofWithBaseSchemaRequestBody(BaseApi): def post_anyof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..f9281027ac3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema + + +application_json = AnyofWithBaseSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py index caa890cfd76..c52c9d65298 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AnyofWithOneEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_anyof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_anyof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_anyof_with_one_empty_schema_request_body_oapg( @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_anyof_with_one_empty_schema_request_body_oapg( def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_anyof_with_one_empty_schema_request_body( @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_anyof_with_one_empty_schema_request_body( @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_anyof_with_one_empty_schema_request_body( @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_anyof_with_one_empty_schema_request_body( def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi index 06e9f0680b9..73184d8e9ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = AnyofWithOneEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_anyof_with_one_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostAnyofWithOneEmptySchemaRequestBody(BaseApi): def post_anyof_with_one_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..184b2ca6497 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema + + +application_json = AnyofWithOneEmptySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py index 164a202b37d..e581f219360 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ArrayTypeMatchesArrays - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_array_type_matches_arrays_request_body_oapg( @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_array_type_matches_arrays_request_body_oapg( @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_array_type_matches_arrays_request_body_oapg( @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_array_type_matches_arrays_request_body_oapg( def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_array_type_matches_arrays_request_body( @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_array_type_matches_arrays_request_body( @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_array_type_matches_arrays_request_body( @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_array_type_matches_arrays_request_body( def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi index c4bd526c1ed..3df19a7ac46 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ArrayTypeMatchesArrays - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_array_type_matches_arrays_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): @typing.overload def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostArrayTypeMatchesArraysRequestBody(BaseApi): def post_array_type_matches_arrays_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body.py new file mode 100644 index 00000000000..0e5493a9134 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays + + +application_json = ArrayTypeMatchesArrays + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py index c4515ab8d82..ddb24d3ebaf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = BooleanTypeMatchesBooleans - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_boolean_type_matches_booleans_request_body_oapg( @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_boolean_type_matches_booleans_request_body_oapg( @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_boolean_type_matches_booleans_request_body_oapg( @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_boolean_type_matches_booleans_request_body_oapg( def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_boolean_type_matches_booleans_request_body( @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_boolean_type_matches_booleans_request_body( @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_boolean_type_matches_booleans_request_body( @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_boolean_type_matches_booleans_request_body( def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi index c7ddbbad910..80470e0ccc7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.boolean_type_matches_booleans import BooleanTypeMatchesBooleans from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = BooleanTypeMatchesBooleans - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_boolean_type_matches_booleans_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): @typing.overload def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostBooleanTypeMatchesBooleansRequestBody(BaseApi): def post_boolean_type_matches_booleans_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body.py new file mode 100644 index 00000000000..8c2ed3f4134 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.boolean_type_matches_booleans import BooleanTypeMatchesBooleans + + +application_json = BooleanTypeMatchesBooleans + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py index c5728aa9745..be9d1668fdf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ByInt - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_by_int_request_body_oapg( @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_by_int_request_body_oapg( @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_by_int_request_body_oapg( @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_by_int_request_body_oapg( def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostByIntRequestBody(BaseApi): @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_by_int_request_body( @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_by_int_request_body( @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_by_int_request_body( @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_by_int_request_body( def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi index 779c7a3c633..71291bd70c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.by_int import ByInt from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ByInt - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_by_int_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostByIntRequestBody(BaseApi): @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostByIntRequestBody(BaseApi): @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostByIntRequestBody(BaseApi): @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostByIntRequestBody(BaseApi): @typing.overload def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostByIntRequestBody(BaseApi): def post_by_int_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body.py new file mode 100644 index 00000000000..90d9a80ec83 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.by_int import ByInt + + +application_json = ByInt + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py index 63337a0e311..e80094a7e00 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ByNumber - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_by_number_request_body_oapg( @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_by_number_request_body_oapg( @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_by_number_request_body_oapg( @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_by_number_request_body_oapg( def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostByNumberRequestBody(BaseApi): @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_by_number_request_body( @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_by_number_request_body( @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_by_number_request_body( @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_by_number_request_body( def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi index f4b51559749..70ca86ecec0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.by_number import ByNumber from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ByNumber - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_by_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostByNumberRequestBody(BaseApi): @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostByNumberRequestBody(BaseApi): @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostByNumberRequestBody(BaseApi): @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostByNumberRequestBody(BaseApi): @typing.overload def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostByNumberRequestBody(BaseApi): def post_by_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body.py new file mode 100644 index 00000000000..ed5fbe6f5e4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.by_number import ByNumber + + +application_json = ByNumber + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py index 22a3538a8f2..6e70300677f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = BySmallNumber - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_by_small_number_request_body_oapg( @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_by_small_number_request_body_oapg( @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_by_small_number_request_body_oapg( @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_by_small_number_request_body_oapg( def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostBySmallNumberRequestBody(BaseApi): @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_by_small_number_request_body( @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_by_small_number_request_body( @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_by_small_number_request_body( @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_by_small_number_request_body( def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi index fa8c887228f..4db8499d95e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.by_small_number import BySmallNumber from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = BySmallNumber - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_by_small_number_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostBySmallNumberRequestBody(BaseApi): @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostBySmallNumberRequestBody(BaseApi): @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostBySmallNumberRequestBody(BaseApi): @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostBySmallNumberRequestBody(BaseApi): @typing.overload def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostBySmallNumberRequestBody(BaseApi): def post_by_small_number_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body.py new file mode 100644 index 00000000000..3a83355bf06 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.by_small_number import BySmallNumber + + +application_json = BySmallNumber + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py index 712a9031912..952f7c139b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = DateTimeFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_date_time_format_request_body_oapg( @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_date_time_format_request_body_oapg( @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_date_time_format_request_body_oapg( @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_date_time_format_request_body_oapg( def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostDateTimeFormatRequestBody(BaseApi): @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_date_time_format_request_body( @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_date_time_format_request_body( @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_date_time_format_request_body( @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_date_time_format_request_body( def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi index 08a362c02df..3a9a90880ec 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.date_time_format import DateTimeFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = DateTimeFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_date_time_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostDateTimeFormatRequestBody(BaseApi): @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostDateTimeFormatRequestBody(BaseApi): @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostDateTimeFormatRequestBody(BaseApi): @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostDateTimeFormatRequestBody(BaseApi): @typing.overload def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostDateTimeFormatRequestBody(BaseApi): def post_date_time_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body.py new file mode 100644 index 00000000000..ea8f17c5fc8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.date_time_format import DateTimeFormat + + +application_json = DateTimeFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py index 747c4fd4a96..9a716bf9ccb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EmailFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_email_format_request_body_oapg( @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_email_format_request_body_oapg( @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_email_format_request_body_oapg( @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_email_format_request_body_oapg( def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEmailFormatRequestBody(BaseApi): @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_email_format_request_body( @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_email_format_request_body( @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_email_format_request_body( @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_email_format_request_body( def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi index 2fa69c0b64c..324bdf370c6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.email_format import EmailFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EmailFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_email_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEmailFormatRequestBody(BaseApi): @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEmailFormatRequestBody(BaseApi): @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEmailFormatRequestBody(BaseApi): @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEmailFormatRequestBody(BaseApi): @typing.overload def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEmailFormatRequestBody(BaseApi): def post_email_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body.py new file mode 100644 index 00000000000..dcdc60a397a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.email_format import EmailFormat + + +application_json = EmailFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py index 263f563ab26..91e52d208c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumWith0DoesNotMatchFalse - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enum_with0_does_not_match_false_request_body_oapg( @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enum_with0_does_not_match_false_request_body_oapg( @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enum_with0_does_not_match_false_request_body_oapg( @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enum_with0_does_not_match_false_request_body_oapg( def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enum_with0_does_not_match_false_request_body( @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enum_with0_does_not_match_false_request_body( @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enum_with0_does_not_match_false_request_body( @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enum_with0_does_not_match_false_request_body( def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi index d22e31a208f..e64b02a6620 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumWith0DoesNotMatchFalse - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enum_with0_does_not_match_false_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumWith0DoesNotMatchFalseRequestBody(BaseApi): def post_enum_with0_does_not_match_false_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body.py new file mode 100644 index 00000000000..29ecb30cd09 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse + + +application_json = EnumWith0DoesNotMatchFalse + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py index 355c141e466..6f967f10fc5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumWith1DoesNotMatchTrue - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enum_with1_does_not_match_true_request_body_oapg( @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enum_with1_does_not_match_true_request_body_oapg( @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enum_with1_does_not_match_true_request_body_oapg( @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enum_with1_does_not_match_true_request_body_oapg( def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enum_with1_does_not_match_true_request_body( @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enum_with1_does_not_match_true_request_body( @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enum_with1_does_not_match_true_request_body( @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enum_with1_does_not_match_true_request_body( def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi index 7ace200fb6f..c457ddbbb13 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumWith1DoesNotMatchTrue - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enum_with1_does_not_match_true_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumWith1DoesNotMatchTrueRequestBody(BaseApi): def post_enum_with1_does_not_match_true_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body.py new file mode 100644 index 00000000000..f6d2acabd6f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue + + +application_json = EnumWith1DoesNotMatchTrue + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py index 25b4a9655b7..9c7486fc09b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enum_with_escaped_characters_request_body_oapg( @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enum_with_escaped_characters_request_body_oapg( @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enum_with_escaped_characters_request_body_oapg( @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enum_with_escaped_characters_request_body_oapg( def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enum_with_escaped_characters_request_body( @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enum_with_escaped_characters_request_body( @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enum_with_escaped_characters_request_body( @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enum_with_escaped_characters_request_body( def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi index 7dfa44fe938..dca867d52ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enum_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumWithEscapedCharactersRequestBody(BaseApi): def post_enum_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body.py new file mode 100644 index 00000000000..578e5f6a1bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters + + +application_json = EnumWithEscapedCharacters + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py index e312bad827c..8d503876b8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumWithFalseDoesNotMatch0 - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enum_with_false_does_not_match0_request_body_oapg( @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enum_with_false_does_not_match0_request_body_oapg( @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enum_with_false_does_not_match0_request_body_oapg( @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enum_with_false_does_not_match0_request_body_oapg( def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enum_with_false_does_not_match0_request_body( @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enum_with_false_does_not_match0_request_body( @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enum_with_false_does_not_match0_request_body( @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enum_with_false_does_not_match0_request_body( def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi index 56971de21c3..76fc9ef4658 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumWithFalseDoesNotMatch0 - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enum_with_false_does_not_match0_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumWithFalseDoesNotMatch0RequestBody(BaseApi): def post_enum_with_false_does_not_match0_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body.py new file mode 100644 index 00000000000..0bc292ffb67 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 + + +application_json = EnumWithFalseDoesNotMatch0 + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py index f82df3450ac..c57ad9e9967 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumWithTrueDoesNotMatch1 - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enum_with_true_does_not_match1_request_body_oapg( @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enum_with_true_does_not_match1_request_body_oapg( @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enum_with_true_does_not_match1_request_body_oapg( @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enum_with_true_does_not_match1_request_body_oapg( def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enum_with_true_does_not_match1_request_body( @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enum_with_true_does_not_match1_request_body( @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enum_with_true_does_not_match1_request_body( @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enum_with_true_does_not_match1_request_body( def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi index 693914a8c52..659658c9d3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumWithTrueDoesNotMatch1 - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enum_with_true_does_not_match1_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumWithTrueDoesNotMatch1RequestBody(BaseApi): def post_enum_with_true_does_not_match1_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body.py new file mode 100644 index 00000000000..6def01224ed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 + + +application_json = EnumWithTrueDoesNotMatch1 + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py index 4191a7652f6..f134e9eff22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = EnumsInProperties - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_enums_in_properties_request_body_oapg( @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_enums_in_properties_request_body_oapg( @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_enums_in_properties_request_body_oapg( @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_enums_in_properties_request_body_oapg( def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_enums_in_properties_request_body( @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_enums_in_properties_request_body( @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_enums_in_properties_request_body( @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_enums_in_properties_request_body( def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi index b0e52f289aa..54ee1f64804 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.enums_in_properties import EnumsInProperties from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = EnumsInProperties - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_enums_in_properties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): @typing.overload def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostEnumsInPropertiesRequestBody(BaseApi): def post_enums_in_properties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body.py new file mode 100644 index 00000000000..2f7871800e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.enums_in_properties import EnumsInProperties + + +application_json = EnumsInProperties + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py index 9b1744738a1..d1d28cd8cf4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ForbiddenProperty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_forbidden_property_request_body_oapg( @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_forbidden_property_request_body_oapg( @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_forbidden_property_request_body_oapg( @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_forbidden_property_request_body_oapg( def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_forbidden_property_request_body( @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_forbidden_property_request_body( @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_forbidden_property_request_body( @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_forbidden_property_request_body( def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi index 56769a5273c..2d72a735411 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.forbidden_property import ForbiddenProperty from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ForbiddenProperty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_forbidden_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): @typing.overload def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostForbiddenPropertyRequestBody(BaseApi): def post_forbidden_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body.py new file mode 100644 index 00000000000..3c6b5b6e8fb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.forbidden_property import ForbiddenProperty + + +application_json = ForbiddenProperty + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py index 06ab0b855aa..3c58241f45c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = HostnameFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_hostname_format_request_body_oapg( @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_hostname_format_request_body_oapg( @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_hostname_format_request_body_oapg( @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_hostname_format_request_body_oapg( def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostHostnameFormatRequestBody(BaseApi): @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_hostname_format_request_body( @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_hostname_format_request_body( @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_hostname_format_request_body( @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_hostname_format_request_body( def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi index a32120bcf46..26188242bef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.hostname_format import HostnameFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = HostnameFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_hostname_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostHostnameFormatRequestBody(BaseApi): @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostHostnameFormatRequestBody(BaseApi): @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostHostnameFormatRequestBody(BaseApi): @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostHostnameFormatRequestBody(BaseApi): @typing.overload def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostHostnameFormatRequestBody(BaseApi): def post_hostname_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body.py new file mode 100644 index 00000000000..f166e11543a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.hostname_format import HostnameFormat + + +application_json = HostnameFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py index 4c90653670e..1e11d0b7869 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = IntegerTypeMatchesIntegers - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_integer_type_matches_integers_request_body_oapg( @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_integer_type_matches_integers_request_body_oapg( @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_integer_type_matches_integers_request_body_oapg( @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_integer_type_matches_integers_request_body_oapg( def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_integer_type_matches_integers_request_body( @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_integer_type_matches_integers_request_body( @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_integer_type_matches_integers_request_body( @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_integer_type_matches_integers_request_body( def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi index 556d4aa5c3e..7c5f08975ff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.integer_type_matches_integers import IntegerTypeMatchesIntegers from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = IntegerTypeMatchesIntegers - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_integer_type_matches_integers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): @typing.overload def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostIntegerTypeMatchesIntegersRequestBody(BaseApi): def post_integer_type_matches_integers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body.py new file mode 100644 index 00000000000..4ad3bdbec68 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.integer_type_matches_integers import IntegerTypeMatchesIntegers + + +application_json = IntegerTypeMatchesIntegers + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py index 2b80770abea..6c9cf965228 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_invalid_instance_should_not_raise_error_when_float_division_inf_reques @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_invalid_instance_should_not_raise_error_when_float_division_inf_reques @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_invalid_instance_should_not_raise_error_when_float_division_inf_reques @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_invalid_instance_should_not_raise_error_when_float_division_inf_reques def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_invalid_instance_should_not_raise_error_when_float_division_inf_request @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_invalid_instance_should_not_raise_error_when_float_division_inf_request @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_invalid_instance_should_not_raise_error_when_float_division_inf_request @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_invalid_instance_should_not_raise_error_when_float_division_inf_request def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi index f349b81a003..0f63c60d103 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(Base def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body.py new file mode 100644 index 00000000000..9f51d4a1227 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + + +application_json = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py index ada20d4b8d1..b68648a770e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = InvalidStringValueForDefault - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_invalid_string_value_for_default_request_body_oapg( @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_invalid_string_value_for_default_request_body_oapg( @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_invalid_string_value_for_default_request_body_oapg( @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_invalid_string_value_for_default_request_body_oapg( def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_invalid_string_value_for_default_request_body( @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_invalid_string_value_for_default_request_body( @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_invalid_string_value_for_default_request_body( @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_invalid_string_value_for_default_request_body( def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi index f3a71721954..9f49bfe7a63 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = InvalidStringValueForDefault - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_invalid_string_value_for_default_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): @typing.overload def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostInvalidStringValueForDefaultRequestBody(BaseApi): def post_invalid_string_value_for_default_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body.py new file mode 100644 index 00000000000..697b048d4e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault + + +application_json = InvalidStringValueForDefault + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py index 14176c34de2..0fd7b449c0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Ipv4Format - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ipv4_format_request_body_oapg( @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ipv4_format_request_body_oapg( @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ipv4_format_request_body_oapg( @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ipv4_format_request_body_oapg( def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostIpv4FormatRequestBody(BaseApi): @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ipv4_format_request_body( @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ipv4_format_request_body( @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ipv4_format_request_body( @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ipv4_format_request_body( def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi index 8ba64e14106..a05f5844baa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ipv4_format import Ipv4Format from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Ipv4Format - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ipv4_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostIpv4FormatRequestBody(BaseApi): @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostIpv4FormatRequestBody(BaseApi): @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostIpv4FormatRequestBody(BaseApi): @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostIpv4FormatRequestBody(BaseApi): @typing.overload def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostIpv4FormatRequestBody(BaseApi): def post_ipv4_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body.py new file mode 100644 index 00000000000..7f093a60ccb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ipv4_format import Ipv4Format + + +application_json = Ipv4Format + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py index e2500e7b2e3..92a590f6190 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Ipv6Format - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ipv6_format_request_body_oapg( @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ipv6_format_request_body_oapg( @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ipv6_format_request_body_oapg( @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ipv6_format_request_body_oapg( def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostIpv6FormatRequestBody(BaseApi): @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ipv6_format_request_body( @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ipv6_format_request_body( @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ipv6_format_request_body( @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ipv6_format_request_body( def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi index 87f9d0d0fe4..8f2dc1960a1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ipv6_format import Ipv6Format from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Ipv6Format - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ipv6_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostIpv6FormatRequestBody(BaseApi): @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostIpv6FormatRequestBody(BaseApi): @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostIpv6FormatRequestBody(BaseApi): @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostIpv6FormatRequestBody(BaseApi): @typing.overload def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostIpv6FormatRequestBody(BaseApi): def post_ipv6_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body.py new file mode 100644 index 00000000000..237695aa6e7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ipv6_format import Ipv6Format + + +application_json = Ipv6Format + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py index 1259e4a8367..9f057bb7058 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = JsonPointerFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_json_pointer_format_request_body_oapg( @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_json_pointer_format_request_body_oapg( @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_json_pointer_format_request_body_oapg( @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_json_pointer_format_request_body_oapg( def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_json_pointer_format_request_body( @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_json_pointer_format_request_body( @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_json_pointer_format_request_body( @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_json_pointer_format_request_body( def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi index 7cf84230728..b079f09e324 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.json_pointer_format import JsonPointerFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = JsonPointerFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_json_pointer_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): @typing.overload def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): def post_json_pointer_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body.py new file mode 100644 index 00000000000..83764f518ef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.json_pointer_format import JsonPointerFormat + + +application_json = JsonPointerFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py index a0771a1e7b6..c2d3d9e1516 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MaximumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maximum_validation_request_body_oapg( @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maximum_validation_request_body_oapg( @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maximum_validation_request_body_oapg( @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maximum_validation_request_body_oapg( def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaximumValidationRequestBody(BaseApi): @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maximum_validation_request_body( @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maximum_validation_request_body( @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maximum_validation_request_body( @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maximum_validation_request_body( def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi index ca9a3084940..0ee76b1edd8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maximum_validation import MaximumValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MaximumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maximum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaximumValidationRequestBody(BaseApi): @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaximumValidationRequestBody(BaseApi): @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaximumValidationRequestBody(BaseApi): @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaximumValidationRequestBody(BaseApi): @typing.overload def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaximumValidationRequestBody(BaseApi): def post_maximum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..d4d734e78aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maximum_validation import MaximumValidation + + +application_json = MaximumValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py index 0761ee85106..c66782292b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MaximumValidationWithUnsignedInteger - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maximum_validation_with_unsigned_integer_request_body_oapg( @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maximum_validation_with_unsigned_integer_request_body_oapg( @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maximum_validation_with_unsigned_integer_request_body_oapg( @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maximum_validation_with_unsigned_integer_request_body_oapg( def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maximum_validation_with_unsigned_integer_request_body( @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maximum_validation_with_unsigned_integer_request_body( @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maximum_validation_with_unsigned_integer_request_body( @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maximum_validation_with_unsigned_integer_request_body( def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi index 88d90ba6ec0..237dc5ae46b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MaximumValidationWithUnsignedInteger - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maximum_validation_with_unsigned_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): @typing.overload def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaximumValidationWithUnsignedIntegerRequestBody(BaseApi): def post_maximum_validation_with_unsigned_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body.py new file mode 100644 index 00000000000..409c44595b9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger + + +application_json = MaximumValidationWithUnsignedInteger + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py index e58df3a1f68..172f3d32be2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MaxitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maxitems_validation_request_body_oapg( @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maxitems_validation_request_body_oapg( @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maxitems_validation_request_body_oapg( @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maxitems_validation_request_body_oapg( def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maxitems_validation_request_body( @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maxitems_validation_request_body( @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maxitems_validation_request_body( @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maxitems_validation_request_body( def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi index 9276ebbbc85..3782ed4f7a5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maxitems_validation import MaxitemsValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MaxitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maxitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): @typing.overload def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaxitemsValidationRequestBody(BaseApi): def post_maxitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..8dda3818f15 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maxitems_validation import MaxitemsValidation + + +application_json = MaxitemsValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py index 121d858a204..d551f1996ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MaxlengthValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maxlength_validation_request_body_oapg( @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maxlength_validation_request_body_oapg( @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maxlength_validation_request_body_oapg( @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maxlength_validation_request_body_oapg( def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maxlength_validation_request_body( @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maxlength_validation_request_body( @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maxlength_validation_request_body( @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maxlength_validation_request_body( def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi index 92a7b987edc..f76523e4278 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maxlength_validation import MaxlengthValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MaxlengthValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maxlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): @typing.overload def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaxlengthValidationRequestBody(BaseApi): def post_maxlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..de047472a4d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maxlength_validation import MaxlengthValidation + + +application_json = MaxlengthValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py index 8f24c308fd8..6523a26e996 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Maxproperties0MeansTheObjectIsEmpty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maxproperties0_means_the_object_is_empty_request_body( @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maxproperties0_means_the_object_is_empty_request_body( @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maxproperties0_means_the_object_is_empty_request_body( @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maxproperties0_means_the_object_is_empty_request_body( def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi index a9f10243804..3e5996a76d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Maxproperties0MeansTheObjectIsEmpty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maxproperties0_means_the_object_is_empty_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): @typing.overload def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(BaseApi): def post_maxproperties0_means_the_object_is_empty_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body.py new file mode 100644 index 00000000000..0273b49cc35 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty + + +application_json = Maxproperties0MeansTheObjectIsEmpty + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py index cd0c1f72fe0..f62b1a979a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MaxpropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_maxproperties_validation_request_body_oapg( @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_maxproperties_validation_request_body_oapg( @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_maxproperties_validation_request_body_oapg( @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_maxproperties_validation_request_body_oapg( def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_maxproperties_validation_request_body( @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_maxproperties_validation_request_body( @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_maxproperties_validation_request_body( @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_maxproperties_validation_request_body( def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi index 5f31216b4c3..4276cd53a58 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MaxpropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_maxproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): @typing.overload def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMaxpropertiesValidationRequestBody(BaseApi): def post_maxproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..0209b1cabe8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation + + +application_json = MaxpropertiesValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py index bfef05be67d..9f2c71e0428 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MinimumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_minimum_validation_request_body_oapg( @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_minimum_validation_request_body_oapg( @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_minimum_validation_request_body_oapg( @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_minimum_validation_request_body_oapg( def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMinimumValidationRequestBody(BaseApi): @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_minimum_validation_request_body( @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_minimum_validation_request_body( @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_minimum_validation_request_body( @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_minimum_validation_request_body( def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi index 6e0a8d1b0f2..1a2e43d3d57 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.minimum_validation import MinimumValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MinimumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_minimum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMinimumValidationRequestBody(BaseApi): @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMinimumValidationRequestBody(BaseApi): @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMinimumValidationRequestBody(BaseApi): @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMinimumValidationRequestBody(BaseApi): @typing.overload def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMinimumValidationRequestBody(BaseApi): def post_minimum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..6753a9b9ad3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.minimum_validation import MinimumValidation + + +application_json = MinimumValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py index c4902e8de6e..368a68f2a3c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MinimumValidationWithSignedInteger - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_minimum_validation_with_signed_integer_request_body_oapg( @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_minimum_validation_with_signed_integer_request_body_oapg( @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_minimum_validation_with_signed_integer_request_body_oapg( @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_minimum_validation_with_signed_integer_request_body_oapg( def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_minimum_validation_with_signed_integer_request_body( @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_minimum_validation_with_signed_integer_request_body( @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_minimum_validation_with_signed_integer_request_body( @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_minimum_validation_with_signed_integer_request_body( def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi index d7aa1a91082..9cec43dafb6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MinimumValidationWithSignedInteger - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_minimum_validation_with_signed_integer_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): @typing.overload def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMinimumValidationWithSignedIntegerRequestBody(BaseApi): def post_minimum_validation_with_signed_integer_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body.py new file mode 100644 index 00000000000..a4cfb57c4b6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger + + +application_json = MinimumValidationWithSignedInteger + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py index 6e56ccc1308..a2d1472f9a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MinitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_minitems_validation_request_body_oapg( @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_minitems_validation_request_body_oapg( @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_minitems_validation_request_body_oapg( @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_minitems_validation_request_body_oapg( def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMinitemsValidationRequestBody(BaseApi): @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_minitems_validation_request_body( @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_minitems_validation_request_body( @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_minitems_validation_request_body( @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_minitems_validation_request_body( def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi index 403998c0f80..0f9d575c67c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.minitems_validation import MinitemsValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MinitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_minitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMinitemsValidationRequestBody(BaseApi): @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMinitemsValidationRequestBody(BaseApi): @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMinitemsValidationRequestBody(BaseApi): @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMinitemsValidationRequestBody(BaseApi): @typing.overload def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMinitemsValidationRequestBody(BaseApi): def post_minitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..6ade15c1b01 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.minitems_validation import MinitemsValidation + + +application_json = MinitemsValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py index f863d1535a9..df6fb00a4c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MinlengthValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_minlength_validation_request_body_oapg( @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_minlength_validation_request_body_oapg( @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_minlength_validation_request_body_oapg( @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_minlength_validation_request_body_oapg( def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMinlengthValidationRequestBody(BaseApi): @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_minlength_validation_request_body( @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_minlength_validation_request_body( @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_minlength_validation_request_body( @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_minlength_validation_request_body( def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi index 02bc19ee81a..823f0fde73e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.minlength_validation import MinlengthValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MinlengthValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_minlength_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMinlengthValidationRequestBody(BaseApi): @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMinlengthValidationRequestBody(BaseApi): @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMinlengthValidationRequestBody(BaseApi): @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMinlengthValidationRequestBody(BaseApi): @typing.overload def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMinlengthValidationRequestBody(BaseApi): def post_minlength_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..36d9eea3931 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.minlength_validation import MinlengthValidation + + +application_json = MinlengthValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py index 81c5ccd640c..bec54091e10 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = MinpropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_minproperties_validation_request_body_oapg( @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_minproperties_validation_request_body_oapg( @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_minproperties_validation_request_body_oapg( @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_minproperties_validation_request_body_oapg( def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_minproperties_validation_request_body( @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_minproperties_validation_request_body( @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_minproperties_validation_request_body( @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_minproperties_validation_request_body( def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi index 02d829808d4..6795c506398 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.minproperties_validation import MinpropertiesValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = MinpropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_minproperties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): @typing.overload def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostMinpropertiesValidationRequestBody(BaseApi): def post_minproperties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..d13efb041e3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.minproperties_validation import MinpropertiesValidation + + +application_json = MinpropertiesValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py index 17ac007003f..f937fefb152 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NestedAllofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_nested_allof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_nested_allof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_nested_allof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_nested_allof_to_check_validation_semantics_request_body_oapg( def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_nested_allof_to_check_validation_semantics_request_body( @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_nested_allof_to_check_validation_semantics_request_body( @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_nested_allof_to_check_validation_semantics_request_body( @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_nested_allof_to_check_validation_semantics_request_body( def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi index c66ab6cd23c..dd0b66b49cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NestedAllofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_nested_allof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNestedAllofToCheckValidationSemanticsRequestBody(BaseApi): def post_nested_allof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body.py new file mode 100644 index 00000000000..e79e955ab33 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics + + +application_json = NestedAllofToCheckValidationSemantics + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py index 8ed6bbc08d0..ab1e91d78ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NestedAnyofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_nested_anyof_to_check_validation_semantics_request_body( @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_nested_anyof_to_check_validation_semantics_request_body( @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_nested_anyof_to_check_validation_semantics_request_body( @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_nested_anyof_to_check_validation_semantics_request_body( def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi index 93ab8652c75..9120be06e12 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NestedAnyofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_nested_anyof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNestedAnyofToCheckValidationSemanticsRequestBody(BaseApi): def post_nested_anyof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body.py new file mode 100644 index 00000000000..5b0876c9415 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics + + +application_json = NestedAnyofToCheckValidationSemantics + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py index 6c5cb539202..d259020d224 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NestedItems - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_nested_items_request_body_oapg( @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_nested_items_request_body_oapg( @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_nested_items_request_body_oapg( @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_nested_items_request_body_oapg( def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNestedItemsRequestBody(BaseApi): @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_nested_items_request_body( @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_nested_items_request_body( @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_nested_items_request_body( @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_nested_items_request_body( def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi index 351ebebbec9..d7ab7d36432 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.nested_items import NestedItems from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NestedItems - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_nested_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNestedItemsRequestBody(BaseApi): @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNestedItemsRequestBody(BaseApi): @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNestedItemsRequestBody(BaseApi): @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNestedItemsRequestBody(BaseApi): @typing.overload def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNestedItemsRequestBody(BaseApi): def post_nested_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body.py new file mode 100644 index 00000000000..d1fe031e5f8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.nested_items import NestedItems + + +application_json = NestedItems + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py index 0f43316163f..7af8591a898 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NestedOneofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_nested_oneof_to_check_validation_semantics_request_body( @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_nested_oneof_to_check_validation_semantics_request_body( @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_nested_oneof_to_check_validation_semantics_request_body( @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_nested_oneof_to_check_validation_semantics_request_body( def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi index dd705e24fbc..ffcde511c37 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NestedOneofToCheckValidationSemantics - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_nested_oneof_to_check_validation_semantics_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): @typing.overload def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNestedOneofToCheckValidationSemanticsRequestBody(BaseApi): def post_nested_oneof_to_check_validation_semantics_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body.py new file mode 100644 index 00000000000..63ef74f6713 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics + + +application_json = NestedOneofToCheckValidationSemantics + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py index 54e34e96f6b..fdbe6a4476a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NotMoreComplexSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_not_more_complex_schema_request_body_oapg( @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_not_more_complex_schema_request_body_oapg( @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_not_more_complex_schema_request_body_oapg( @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_not_more_complex_schema_request_body_oapg( def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_not_more_complex_schema_request_body( @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_not_more_complex_schema_request_body( @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_not_more_complex_schema_request_body( @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_not_more_complex_schema_request_body( def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi index a95b6367ff9..5caa30cddf2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.not_more_complex_schema import NotMoreComplexSchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NotMoreComplexSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_not_more_complex_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): @typing.overload def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): def post_not_more_complex_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..6fa79b4cbca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.not_more_complex_schema import NotMoreComplexSchema + + +application_json = NotMoreComplexSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py index 782c06f820c..cd34f4185bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ModelNot - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_not_request_body_oapg( @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_not_request_body_oapg( @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_not_request_body_oapg( @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_not_request_body_oapg( def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNotRequestBody(BaseApi): @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_not_request_body( @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_not_request_body( @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_not_request_body( @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_not_request_body( def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi index dc239610dce..f2b7737e5c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.model_not import ModelNot from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ModelNot - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNotRequestBody(BaseApi): @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNotRequestBody(BaseApi): @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNotRequestBody(BaseApi): @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNotRequestBody(BaseApi): @typing.overload def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNotRequestBody(BaseApi): def post_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body.py new file mode 100644 index 00000000000..191061de0d8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.model_not import ModelNot + + +application_json = ModelNot + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py index 2c1b1825f8c..3d459f6a00b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NulCharactersInStrings - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_nul_characters_in_strings_request_body_oapg( @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_nul_characters_in_strings_request_body_oapg( @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_nul_characters_in_strings_request_body_oapg( @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_nul_characters_in_strings_request_body_oapg( def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_nul_characters_in_strings_request_body( @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_nul_characters_in_strings_request_body( @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_nul_characters_in_strings_request_body( @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_nul_characters_in_strings_request_body( def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi index e4a72120461..3ec7398cb41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NulCharactersInStrings - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_nul_characters_in_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): @typing.overload def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNulCharactersInStringsRequestBody(BaseApi): def post_nul_characters_in_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body.py new file mode 100644 index 00000000000..45b4ddd6ce9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings + + +application_json = NulCharactersInStrings + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py index a165a22e182..04a16fd3bc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NullTypeMatchesOnlyTheNullObject - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_null_type_matches_only_the_null_object_request_body_oapg( @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_null_type_matches_only_the_null_object_request_body_oapg( @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_null_type_matches_only_the_null_object_request_body_oapg( @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_null_type_matches_only_the_null_object_request_body_oapg( def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_null_type_matches_only_the_null_object_request_body( @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_null_type_matches_only_the_null_object_request_body( @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_null_type_matches_only_the_null_object_request_body( @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_null_type_matches_only_the_null_object_request_body( def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi index 2657018917c..b160315e34f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NullTypeMatchesOnlyTheNullObject - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_null_type_matches_only_the_null_object_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNullTypeMatchesOnlyTheNullObjectRequestBody(BaseApi): def post_null_type_matches_only_the_null_object_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body.py new file mode 100644 index 00000000000..dbb8ea5fc1d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject + + +application_json = NullTypeMatchesOnlyTheNullObject + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py index 8d6012d7896..3040541109a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NumberTypeMatchesNumbers - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_number_type_matches_numbers_request_body_oapg( @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_number_type_matches_numbers_request_body_oapg( @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_number_type_matches_numbers_request_body_oapg( @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_number_type_matches_numbers_request_body_oapg( def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_number_type_matches_numbers_request_body( @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_number_type_matches_numbers_request_body( @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_number_type_matches_numbers_request_body( @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_number_type_matches_numbers_request_body( def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi index 69f6685c750..23c77e076c5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.number_type_matches_numbers import NumberTypeMatchesNumbers from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = NumberTypeMatchesNumbers - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_number_type_matches_numbers_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): @typing.overload def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostNumberTypeMatchesNumbersRequestBody(BaseApi): def post_number_type_matches_numbers_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body.py new file mode 100644 index 00000000000..49c5d77f3a5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.number_type_matches_numbers import NumberTypeMatchesNumbers + + +application_json = NumberTypeMatchesNumbers + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py index c79985f9b0a..c93871c59bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ObjectPropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_object_properties_validation_request_body_oapg( @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_object_properties_validation_request_body_oapg( @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_object_properties_validation_request_body_oapg( @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_object_properties_validation_request_body_oapg( def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_object_properties_validation_request_body( @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_object_properties_validation_request_body( @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_object_properties_validation_request_body( @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_object_properties_validation_request_body( def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi index b541e0f8038..52b9a73c407 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ObjectPropertiesValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_object_properties_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): @typing.overload def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostObjectPropertiesValidationRequestBody(BaseApi): def post_object_properties_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..4e690c48b04 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation + + +application_json = ObjectPropertiesValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py index 8799c026935..7fc7af732f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ObjectTypeMatchesObjects - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_object_type_matches_objects_request_body_oapg( @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_object_type_matches_objects_request_body_oapg( @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_object_type_matches_objects_request_body_oapg( @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_object_type_matches_objects_request_body_oapg( def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_object_type_matches_objects_request_body( @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_object_type_matches_objects_request_body( @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_object_type_matches_objects_request_body( @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_object_type_matches_objects_request_body( def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi index 6f867ff44cf..bb5cd0ffecb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.object_type_matches_objects import ObjectTypeMatchesObjects from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = ObjectTypeMatchesObjects - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_object_type_matches_objects_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): @typing.overload def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): def post_object_type_matches_objects_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body.py new file mode 100644 index 00000000000..215485e3eed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.object_type_matches_objects import ObjectTypeMatchesObjects + + +application_json = ObjectTypeMatchesObjects + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py index bb2eb7212e2..f36248fe402 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = OneofComplexTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_oneof_complex_types_request_body_oapg( @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_oneof_complex_types_request_body_oapg( @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_oneof_complex_types_request_body_oapg( @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_oneof_complex_types_request_body_oapg( def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_oneof_complex_types_request_body( @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_oneof_complex_types_request_body( @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_oneof_complex_types_request_body( @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_oneof_complex_types_request_body( def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi index 4449576944c..062b33a762f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.oneof_complex_types import OneofComplexTypes from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = OneofComplexTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_oneof_complex_types_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): @typing.overload def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostOneofComplexTypesRequestBody(BaseApi): def post_oneof_complex_types_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body.py new file mode 100644 index 00000000000..49a966f4d27 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.oneof_complex_types import OneofComplexTypes + + +application_json = OneofComplexTypes + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py index b08682e70e5..f5b4cd589c5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Oneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_oneof_request_body_oapg( @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_oneof_request_body_oapg( @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_oneof_request_body_oapg( @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_oneof_request_body_oapg( def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostOneofRequestBody(BaseApi): @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_oneof_request_body( @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_oneof_request_body( @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_oneof_request_body( @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_oneof_request_body( def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi index e9715379cc2..0d07be24939 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.oneof import Oneof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Oneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostOneofRequestBody(BaseApi): @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostOneofRequestBody(BaseApi): @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostOneofRequestBody(BaseApi): @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostOneofRequestBody(BaseApi): @typing.overload def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostOneofRequestBody(BaseApi): def post_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body.py new file mode 100644 index 00000000000..d687ad3bd8a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.oneof import Oneof + + +application_json = Oneof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py index d4031f08a60..56f4e4f6b0a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = OneofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_oneof_with_base_schema_request_body_oapg( @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_oneof_with_base_schema_request_body_oapg( @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_oneof_with_base_schema_request_body_oapg( @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_oneof_with_base_schema_request_body_oapg( def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_oneof_with_base_schema_request_body( @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_oneof_with_base_schema_request_body( @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_oneof_with_base_schema_request_body( @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_oneof_with_base_schema_request_body( def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi index 8381be60394..780882891ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = OneofWithBaseSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_oneof_with_base_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostOneofWithBaseSchemaRequestBody(BaseApi): def post_oneof_with_base_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..dec4ab97735 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema + + +application_json = OneofWithBaseSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py index 0ddb60571fa..9e395611715 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = OneofWithEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_oneof_with_empty_schema_request_body_oapg( @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_oneof_with_empty_schema_request_body_oapg( @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_oneof_with_empty_schema_request_body_oapg( @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_oneof_with_empty_schema_request_body_oapg( def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_oneof_with_empty_schema_request_body( @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_oneof_with_empty_schema_request_body( @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_oneof_with_empty_schema_request_body( @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_oneof_with_empty_schema_request_body( def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi index 2524b27b8fb..5fe4956e071 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = OneofWithEmptySchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_oneof_with_empty_schema_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): @typing.overload def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostOneofWithEmptySchemaRequestBody(BaseApi): def post_oneof_with_empty_schema_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body.py new file mode 100644 index 00000000000..b1848b3135b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema + + +application_json = OneofWithEmptySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py index 519772204e1..ff17f772f91 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = OneofWithRequired - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_oneof_with_required_request_body_oapg( @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_oneof_with_required_request_body_oapg( @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_oneof_with_required_request_body_oapg( @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_oneof_with_required_request_body_oapg( def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_oneof_with_required_request_body( @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_oneof_with_required_request_body( @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_oneof_with_required_request_body( @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_oneof_with_required_request_body( def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi index 79a3850ddc6..0fa00eafabe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.oneof_with_required import OneofWithRequired from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = OneofWithRequired - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_oneof_with_required_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): @typing.overload def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostOneofWithRequiredRequestBody(BaseApi): def post_oneof_with_required_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body.py new file mode 100644 index 00000000000..ff43a2ac73d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.oneof_with_required import OneofWithRequired + + +application_json = OneofWithRequired + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py index 026c9447475..7784da193c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = PatternIsNotAnchored - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_pattern_is_not_anchored_request_body_oapg( @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_pattern_is_not_anchored_request_body_oapg( @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_pattern_is_not_anchored_request_body_oapg( @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_pattern_is_not_anchored_request_body_oapg( def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_pattern_is_not_anchored_request_body( @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_pattern_is_not_anchored_request_body( @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_pattern_is_not_anchored_request_body( @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_pattern_is_not_anchored_request_body( def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi index c9b29dafde0..c275f52edae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = PatternIsNotAnchored - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_pattern_is_not_anchored_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): @typing.overload def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostPatternIsNotAnchoredRequestBody(BaseApi): def post_pattern_is_not_anchored_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body.py new file mode 100644 index 00000000000..badc5815e60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored + + +application_json = PatternIsNotAnchored + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py index 1bb3cf76ca0..b2548ef8f31 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = PatternValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_pattern_validation_request_body_oapg( @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_pattern_validation_request_body_oapg( @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_pattern_validation_request_body_oapg( @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_pattern_validation_request_body_oapg( def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostPatternValidationRequestBody(BaseApi): @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_pattern_validation_request_body( @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_pattern_validation_request_body( @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_pattern_validation_request_body( @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_pattern_validation_request_body( def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi index fd1a76d3282..fb11180c5a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.pattern_validation import PatternValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = PatternValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_pattern_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostPatternValidationRequestBody(BaseApi): @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostPatternValidationRequestBody(BaseApi): @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostPatternValidationRequestBody(BaseApi): @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostPatternValidationRequestBody(BaseApi): @typing.overload def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostPatternValidationRequestBody(BaseApi): def post_pattern_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..f8a74f89011 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.pattern_validation import PatternValidation + + +application_json = PatternValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py index 649fe0049d4..2dc8709d082 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = PropertiesWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_properties_with_escaped_characters_request_body_oapg( @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_properties_with_escaped_characters_request_body_oapg( @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_properties_with_escaped_characters_request_body_oapg( @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_properties_with_escaped_characters_request_body_oapg( def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_properties_with_escaped_characters_request_body( @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_properties_with_escaped_characters_request_body( @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_properties_with_escaped_characters_request_body( @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_properties_with_escaped_characters_request_body( def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi index cfe13c81d3b..db09ab345d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = PropertiesWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_properties_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostPropertiesWithEscapedCharactersRequestBody(BaseApi): def post_properties_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body.py new file mode 100644 index 00000000000..658839c1160 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters + + +application_json = PropertiesWithEscapedCharacters + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py index 7560562b022..01e969dd098 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = PropertyNamedRefThatIsNotAReference - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_property_named_ref_that_is_not_a_reference_request_body( @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_property_named_ref_that_is_not_a_reference_request_body( @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_property_named_ref_that_is_not_a_reference_request_body( @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_property_named_ref_that_is_not_a_reference_request_body( def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi index e5f6205f484..f06b0d71dfc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = PropertyNamedRefThatIsNotAReference - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_property_named_ref_that_is_not_a_reference_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): @typing.overload def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostPropertyNamedRefThatIsNotAReferenceRequestBody(BaseApi): def post_property_named_ref_that_is_not_a_reference_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body.py new file mode 100644 index 00000000000..a2fa916039f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference + + +application_json = PropertyNamedRefThatIsNotAReference + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py index 81d25a6ac05..761586f5854 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInAdditionalproperties - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_additionalproperties_request_body_oapg( @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_additionalproperties_request_body_oapg( @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_additionalproperties_request_body_oapg( @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_additionalproperties_request_body_oapg( def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_additionalproperties_request_body( @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_additionalproperties_request_body( @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_additionalproperties_request_body( @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_additionalproperties_request_body( def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi index 78edf0a05e2..a89912a35d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInAdditionalproperties - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_additionalproperties_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): @typing.overload def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInAdditionalpropertiesRequestBody(BaseApi): def post_ref_in_additionalproperties_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body.py new file mode 100644 index 00000000000..93caa3b29d9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties + + +application_json = RefInAdditionalproperties + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py index dc03e779ccc..4db205f732f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInAllof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_allof_request_body_oapg( @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_allof_request_body_oapg( @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_allof_request_body_oapg( @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_allof_request_body_oapg( def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInAllofRequestBody(BaseApi): @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_allof_request_body( @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_allof_request_body( @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_allof_request_body( @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_allof_request_body( def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi index e0699b64553..3434b159571 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_allof import RefInAllof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInAllof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_allof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInAllofRequestBody(BaseApi): @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInAllofRequestBody(BaseApi): @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInAllofRequestBody(BaseApi): @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInAllofRequestBody(BaseApi): @typing.overload def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInAllofRequestBody(BaseApi): def post_ref_in_allof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body.py new file mode 100644 index 00000000000..754f366cc11 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_allof import RefInAllof + + +application_json = RefInAllof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py index bcfee9da8b8..52cd5941144 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInAnyof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_anyof_request_body_oapg( @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_anyof_request_body_oapg( @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_anyof_request_body_oapg( @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_anyof_request_body_oapg( def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInAnyofRequestBody(BaseApi): @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_anyof_request_body( @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_anyof_request_body( @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_anyof_request_body( @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_anyof_request_body( def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi index 7d58ccbfb6e..a11e562d4d5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_anyof import RefInAnyof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInAnyof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_anyof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInAnyofRequestBody(BaseApi): @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInAnyofRequestBody(BaseApi): @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInAnyofRequestBody(BaseApi): @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInAnyofRequestBody(BaseApi): @typing.overload def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInAnyofRequestBody(BaseApi): def post_ref_in_anyof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body.py new file mode 100644 index 00000000000..04b82a4e0cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_anyof import RefInAnyof + + +application_json = RefInAnyof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py index 8a836762095..c1dfef213c5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInItems - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_items_request_body_oapg( @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_items_request_body_oapg( @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_items_request_body_oapg( @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_items_request_body_oapg( def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInItemsRequestBody(BaseApi): @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_items_request_body( @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_items_request_body( @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_items_request_body( @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_items_request_body( def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi index 15bd83cc7b1..7ee9c87f8a1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_items import RefInItems from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInItems - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_items_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInItemsRequestBody(BaseApi): @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInItemsRequestBody(BaseApi): @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInItemsRequestBody(BaseApi): @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInItemsRequestBody(BaseApi): @typing.overload def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInItemsRequestBody(BaseApi): def post_ref_in_items_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body.py new file mode 100644 index 00000000000..ec1c6725f39 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_items import RefInItems + + +application_json = RefInItems + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py index cd5d4c5738a..ef5f3fa7d2e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInNot - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_not_request_body_oapg( @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_not_request_body_oapg( @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_not_request_body_oapg( @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_not_request_body_oapg( def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInNotRequestBody(BaseApi): @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_not_request_body( @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_not_request_body( @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_not_request_body( @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_not_request_body( def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi index 2d15d763b4d..7ef6be5a222 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_not import RefInNot from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInNot - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_not_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInNotRequestBody(BaseApi): @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInNotRequestBody(BaseApi): @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInNotRequestBody(BaseApi): @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInNotRequestBody(BaseApi): @typing.overload def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInNotRequestBody(BaseApi): def post_ref_in_not_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body.py new file mode 100644 index 00000000000..48357311ad0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_not import RefInNot + + +application_json = RefInNot + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py index 2d96a3d16fc..ad62f903c36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInOneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_oneof_request_body_oapg( @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_oneof_request_body_oapg( @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_oneof_request_body_oapg( @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_oneof_request_body_oapg( def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInOneofRequestBody(BaseApi): @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_oneof_request_body( @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_oneof_request_body( @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_oneof_request_body( @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_oneof_request_body( def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi index 58783a33638..f44212b058a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_oneof import RefInOneof from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInOneof - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_oneof_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInOneofRequestBody(BaseApi): @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInOneofRequestBody(BaseApi): @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInOneofRequestBody(BaseApi): @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInOneofRequestBody(BaseApi): @typing.overload def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInOneofRequestBody(BaseApi): def post_ref_in_oneof_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body.py new file mode 100644 index 00000000000..26e86883258 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_oneof import RefInOneof + + +application_json = RefInOneof + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py index df62cedfa61..28c1e504959 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RefInProperty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_ref_in_property_request_body_oapg( @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_ref_in_property_request_body_oapg( @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_ref_in_property_request_body_oapg( @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_ref_in_property_request_body_oapg( def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRefInPropertyRequestBody(BaseApi): @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_ref_in_property_request_body( @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_ref_in_property_request_body( @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_ref_in_property_request_body( @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_ref_in_property_request_body( def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi index 8299e55bb35..57d3089b820 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.ref_in_property import RefInProperty from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RefInProperty - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_ref_in_property_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRefInPropertyRequestBody(BaseApi): @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRefInPropertyRequestBody(BaseApi): @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRefInPropertyRequestBody(BaseApi): @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRefInPropertyRequestBody(BaseApi): @typing.overload def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRefInPropertyRequestBody(BaseApi): def post_ref_in_property_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body.py new file mode 100644 index 00000000000..8512ffb1cbf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.ref_in_property import RefInProperty + + +application_json = RefInProperty + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py index db344116023..a82f2b7846e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RequiredDefaultValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_required_default_validation_request_body_oapg( @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_required_default_validation_request_body_oapg( @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_required_default_validation_request_body_oapg( @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_required_default_validation_request_body_oapg( def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_required_default_validation_request_body( @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_required_default_validation_request_body( @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_required_default_validation_request_body( @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_required_default_validation_request_body( def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi index e345548d97d..84a2844b16c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.required_default_validation import RequiredDefaultValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RequiredDefaultValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_required_default_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): @typing.overload def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRequiredDefaultValidationRequestBody(BaseApi): def post_required_default_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..968fd56df63 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.required_default_validation import RequiredDefaultValidation + + +application_json = RequiredDefaultValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py index 06b398264a2..274342b5619 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RequiredValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_required_validation_request_body_oapg( @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_required_validation_request_body_oapg( @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_required_validation_request_body_oapg( @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_required_validation_request_body_oapg( def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRequiredValidationRequestBody(BaseApi): @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_required_validation_request_body( @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_required_validation_request_body( @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_required_validation_request_body( @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_required_validation_request_body( def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi index 8a702c34be0..4811e6900da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.required_validation import RequiredValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RequiredValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_required_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRequiredValidationRequestBody(BaseApi): @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRequiredValidationRequestBody(BaseApi): @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRequiredValidationRequestBody(BaseApi): @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRequiredValidationRequestBody(BaseApi): @typing.overload def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRequiredValidationRequestBody(BaseApi): def post_required_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..910f20f4162 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.required_validation import RequiredValidation + + +application_json = RequiredValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py index ff28b4c053b..d67d51f0924 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RequiredWithEmptyArray - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_required_with_empty_array_request_body_oapg( @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_required_with_empty_array_request_body_oapg( @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_required_with_empty_array_request_body_oapg( @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_required_with_empty_array_request_body_oapg( def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_required_with_empty_array_request_body( @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_required_with_empty_array_request_body( @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_required_with_empty_array_request_body( @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_required_with_empty_array_request_body( def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi index f5418a60cbb..9fca3e7ebcc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RequiredWithEmptyArray - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_required_with_empty_array_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): @typing.overload def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRequiredWithEmptyArrayRequestBody(BaseApi): def post_required_with_empty_array_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body.py new file mode 100644 index 00000000000..e06a73ad6a5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray + + +application_json = RequiredWithEmptyArray + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py index 169744086e0..08461a0b292 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = RequiredWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_required_with_escaped_characters_request_body_oapg( @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_required_with_escaped_characters_request_body_oapg( @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_required_with_escaped_characters_request_body_oapg( @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_required_with_escaped_characters_request_body_oapg( def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_required_with_escaped_characters_request_body( @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_required_with_escaped_characters_request_body( @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_required_with_escaped_characters_request_body( @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_required_with_escaped_characters_request_body( def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi index 603c449e446..6fce9a77113 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = RequiredWithEscapedCharacters - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_required_with_escaped_characters_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): @typing.overload def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): def post_required_with_escaped_characters_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body.py new file mode 100644 index 00000000000..2022f32226e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters + + +application_json = RequiredWithEscapedCharacters + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py index 77924b9fd2c..6cd6dd0cbc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = SimpleEnumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_simple_enum_validation_request_body_oapg( @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_simple_enum_validation_request_body_oapg( @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_simple_enum_validation_request_body_oapg( @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_simple_enum_validation_request_body_oapg( def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_simple_enum_validation_request_body( @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_simple_enum_validation_request_body( @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_simple_enum_validation_request_body( @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_simple_enum_validation_request_body( def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi index 4e492fb4de4..922d77aeda8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.simple_enum_validation import SimpleEnumValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = SimpleEnumValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_simple_enum_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): @typing.overload def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostSimpleEnumValidationRequestBody(BaseApi): def post_simple_enum_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..f656544dd48 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation + + +application_json = SimpleEnumValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py index 2d2a78c6f9f..a7ba3061d8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = StringTypeMatchesStrings - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_string_type_matches_strings_request_body_oapg( @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_string_type_matches_strings_request_body_oapg( @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_string_type_matches_strings_request_body_oapg( @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_string_type_matches_strings_request_body_oapg( def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_string_type_matches_strings_request_body( @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_string_type_matches_strings_request_body( @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_string_type_matches_strings_request_body( @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_string_type_matches_strings_request_body( def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi index fd267337131..696b365ad88 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.string_type_matches_strings import StringTypeMatchesStrings from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = StringTypeMatchesStrings - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_string_type_matches_strings_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): @typing.overload def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostStringTypeMatchesStringsRequestBody(BaseApi): def post_string_type_matches_strings_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body.py new file mode 100644 index 00000000000..9a5d5a4bf0c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.string_type_matches_strings import StringTypeMatchesStrings + + +application_json = StringTypeMatchesStrings + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py index 9924b6172d4..30c532a6cdc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_re @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_re @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_re @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_re def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_req @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_req @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_req @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_req def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi index cd5f90d9918..653ba1908ad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(Ba def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body.py new file mode 100644 index 00000000000..d989672c627 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + + +application_json = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py index e4295f3f449..530cf8dccb6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = UniqueitemsFalseValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_uniqueitems_false_validation_request_body_oapg( @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_uniqueitems_false_validation_request_body_oapg( @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_uniqueitems_false_validation_request_body_oapg( @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_uniqueitems_false_validation_request_body_oapg( def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_uniqueitems_false_validation_request_body( @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_uniqueitems_false_validation_request_body( @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_uniqueitems_false_validation_request_body( @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_uniqueitems_false_validation_request_body( def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi index e5fc9ac652c..297e2d51032 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = UniqueitemsFalseValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_uniqueitems_false_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostUniqueitemsFalseValidationRequestBody(BaseApi): def post_uniqueitems_false_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..81adae98d39 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation + + +application_json = UniqueitemsFalseValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py index 9d00119ab17..93a0cba92d5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = UniqueitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_uniqueitems_validation_request_body_oapg( @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_uniqueitems_validation_request_body_oapg( @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_uniqueitems_validation_request_body_oapg( @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_uniqueitems_validation_request_body_oapg( def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_uniqueitems_validation_request_body( @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_uniqueitems_validation_request_body( @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_uniqueitems_validation_request_body( @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_uniqueitems_validation_request_body( def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi index 3ca3c9d4e23..631dcf9f21b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = UniqueitemsValidation - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_uniqueitems_validation_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): @typing.overload def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostUniqueitemsValidationRequestBody(BaseApi): def post_uniqueitems_validation_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body.py new file mode 100644 index 00000000000..d6f57a4e3de --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation + + +application_json = UniqueitemsValidation + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py index 093f62594bb..39eb2266762 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = UriFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_uri_format_request_body_oapg( @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_uri_format_request_body_oapg( @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_uri_format_request_body_oapg( @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_uri_format_request_body_oapg( def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostUriFormatRequestBody(BaseApi): @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_uri_format_request_body( @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_uri_format_request_body( @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_uri_format_request_body( @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_uri_format_request_body( def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi index e9b00d89de6..5da19af09df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.uri_format import UriFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = UriFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_uri_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostUriFormatRequestBody(BaseApi): @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostUriFormatRequestBody(BaseApi): @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostUriFormatRequestBody(BaseApi): @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostUriFormatRequestBody(BaseApi): @typing.overload def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostUriFormatRequestBody(BaseApi): def post_uri_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body.py new file mode 100644 index 00000000000..668f0429431 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.uri_format import UriFormat + + +application_json = UriFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py index e3ccb890410..6d44c1c78cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = UriReferenceFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_uri_reference_format_request_body_oapg( @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_uri_reference_format_request_body_oapg( @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_uri_reference_format_request_body_oapg( @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_uri_reference_format_request_body_oapg( def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_uri_reference_format_request_body( @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_uri_reference_format_request_body( @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_uri_reference_format_request_body( @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_uri_reference_format_request_body( def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi index 78d5c544193..d8f65983598 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.uri_reference_format import UriReferenceFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = UriReferenceFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_uri_reference_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): @typing.overload def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): def post_uri_reference_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body.py new file mode 100644 index 00000000000..396547a554e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.uri_reference_format import UriReferenceFormat + + +application_json = UriReferenceFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py index 0d6cc5b8c0d..609f13cd95b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = UriTemplateFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _post_uri_template_format_request_body_oapg( @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _post_uri_template_format_request_body_oapg( @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _post_uri_template_format_request_body_oapg( @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _post_uri_template_format_request_body_oapg( def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def post_uri_template_format_request_body( @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def post_uri_template_format_request_body( @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def post_uri_template_format_request_body( @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def post_uri_template_format_request_body( def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi index 7902aced000..ad4181075ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi @@ -28,28 +28,15 @@ from unit_test_api import schemas # noqa: F401 from unit_test_api.model.uri_template_format import UriTemplateFormat from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = UriTemplateFormat - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _post_uri_template_format_request_body_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): @typing.overload def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): def post_uri_template_format_request_body( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body.py new file mode 100644 index 00000000000..a8d04362cc0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from unit_test_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +from unit_test_api.model.uri_template_format import UriTemplateFormat + + +application_json = UriTemplateFormat + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md index 7f698cf05b0..b213274e904 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/apis/tags/DefaultApi.md @@ -46,15 +46,15 @@ with this_package.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#post_operators.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#post_operators.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#post_operators.request_body) | typing.Union[[request_body.application_json](#post_operators.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Operator**](../../models/Operator.md) | | diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py index e02bf809a11..8707bf777d1 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Operator - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +42,7 @@ class BaseApi(api_client.Api): def _post_operators_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -66,7 +54,7 @@ def _post_operators_oapg( def _post_operators_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -80,7 +68,7 @@ def _post_operators_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -89,7 +77,7 @@ def _post_operators_oapg( def _post_operators_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -101,7 +89,7 @@ def _post_operators_oapg( def _post_operators_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -119,7 +107,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -157,7 +145,7 @@ class PostOperators(BaseApi): def post_operators( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -169,7 +157,7 @@ def post_operators( def post_operators( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -183,7 +171,7 @@ def post_operators( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -192,7 +180,7 @@ def post_operators( def post_operators( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -204,7 +192,7 @@ def post_operators( def post_operators( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -225,7 +213,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -237,7 +225,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -251,7 +239,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -260,7 +248,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -272,7 +260,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi index 94e55528f7e..15ce07c06ac 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi @@ -28,28 +28,16 @@ from this_package import schemas # noqa: F401 from this_package.model.operator import Operator from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = Operator - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _post_operators_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -61,7 +49,7 @@ class BaseApi(api_client.Api): def _post_operators_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -75,7 +63,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -84,7 +72,7 @@ class BaseApi(api_client.Api): def _post_operators_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -96,7 +84,7 @@ class BaseApi(api_client.Api): def _post_operators_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -114,7 +102,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -152,7 +140,7 @@ class PostOperators(BaseApi): def post_operators( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -164,7 +152,7 @@ class PostOperators(BaseApi): def post_operators( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -178,7 +166,7 @@ class PostOperators(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -187,7 +175,7 @@ class PostOperators(BaseApi): def post_operators( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -199,7 +187,7 @@ class PostOperators(BaseApi): def post_operators( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -220,7 +208,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -232,7 +220,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -246,7 +234,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -255,7 +243,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -267,7 +255,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body.py new file mode 100644 index 00000000000..3dddc6191c1 --- /dev/null +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from this_package import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from this_package import schemas # noqa: F401 + +from this_package.model.operator import Operator + + +application_json = Operator + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md index 9e3e1779229..35977ee2192 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md @@ -49,16 +49,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#call_123_test_special_tags.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#call_123_test_special_tags.RequestBody.Schemas.application_json)] | required | +[body](#call_123_test_special_tags.request_body) | typing.Union[[request_body.application_json](#call_123_test_special_tags.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Client**](../../models/Client.md) | | diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md index f65600a5042..f0f0bd79cfb 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md @@ -81,16 +81,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#additional_properties_with_array_of_enums.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#additional_properties_with_array_of_enums.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#additional_properties_with_array_of_enums.request_body) | typing.Union[[request_body.application_json](#additional_properties_with_array_of_enums.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AdditionalPropertiesWithArrayOfEnums**](../../models/AdditionalPropertiesWithArrayOfEnums.md) | | @@ -162,16 +162,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#array_model.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#array_model.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#array_model.request_body) | typing.Union[[request_body.application_json](#array_model.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**AnimalFarm**](../../models/AnimalFarm.md) | | @@ -243,16 +243,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#array_of_enums.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#array_of_enums.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#array_of_enums.request_body) | typing.Union[[request_body.application_json](#array_of_enums.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ArrayOfEnums**](../../models/ArrayOfEnums.md) | | @@ -328,15 +328,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#body_with_file_schema.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#body_with_file_schema.RequestBody.Schemas.application_json)] | required | +[body](#body_with_file_schema.request_body) | typing.Union[[request_body.application_json](#body_with_file_schema.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**FileSchemaTestClass**](../../models/FileSchemaTestClass.md) | | @@ -415,16 +415,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#body_with_query_params.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#body_with_query_params.RequestBody.Schemas.application_json)] | required | +[body](#body_with_query_params.request_body) | typing.Union[[request_body.application_json](#body_with_query_params.request_body.application_json)] | required | [query_params](#body_with_query_params.RequestQueryParameters) | [RequestQueryParameters.Params](#body_with_query_params.RequestQueryParameters.Params) | | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**User**](../../models/User.md) | | @@ -503,16 +503,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#boolean.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#boolean.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#boolean.request_body) | typing.Union[[request_body.application_json](#boolean.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Boolean**](../../models/Boolean.md) | | @@ -682,16 +682,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#client_model.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#client_model.RequestBody.Schemas.application_json)] | required | +[body](#client_model.request_body) | typing.Union[[request_body.application_json](#client_model.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Client**](../../models/Client.md) | | @@ -761,16 +761,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#composed_one_of_different_types.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#composed_one_of_different_types.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#composed_one_of_different_types.request_body) | typing.Union[[request_body.application_json](#composed_one_of_different_types.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ComposedOneOfDifferentTypes**](../../models/ComposedOneOfDifferentTypes.md) | | @@ -953,15 +953,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#endpoint_parameters.RequestBody) | typing.Union[[RequestBody.Schemas.application_x_www_form_urlencoded](#endpoint_parameters.RequestBody.Schemas.application_x_www_form_urlencoded), Unset] | optional, default is unset | +[body](#endpoint_parameters.request_body) | typing.Union[[request_body.application_x_www_form_urlencoded](#endpoint_parameters.request_body.application_x_www_form_urlencoded), Unset] | optional, default is unset | content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_x_www_form_urlencoded +# request_body.application_x_www_form_urlencoded ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1074,7 +1074,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#enum_parameters.RequestBody) | typing.Union[[RequestBody.Schemas.application_x_www_form_urlencoded](#enum_parameters.RequestBody.Schemas.application_x_www_form_urlencoded), Unset] | optional, default is unset | +[body](#enum_parameters.request_body) | typing.Union[[request_body.application_x_www_form_urlencoded](#enum_parameters.request_body.application_x_www_form_urlencoded), Unset] | optional, default is unset | [query_params](#enum_parameters.RequestQueryParameters) | [RequestQueryParameters.Params](#enum_parameters.RequestQueryParameters.Params) | | [header_params](#enum_parameters.RequestHeaderParameters) | [RequestHeaderParameters.Params](#enum_parameters.RequestHeaderParameters.Params) | | content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body @@ -1082,9 +1082,9 @@ stream | bool | default is False | if True then the response.content will be str timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_x_www_form_urlencoded +# request_body.application_x_www_form_urlencoded ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1470,15 +1470,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#inline_additional_properties.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#inline_additional_properties.RequestBody.Schemas.application_json)] | required | +[body](#inline_additional_properties.request_body) | typing.Union[[request_body.application_json](#inline_additional_properties.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1554,7 +1554,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#inline_composition.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#inline_composition.RequestBody.Schemas.application_json), [RequestBody.Schemas.multipart_form_data](#inline_composition.RequestBody.Schemas.multipart_form_data), Unset] | optional, default is unset | +[body](#inline_composition.request_body) | typing.Union[[request_body.application_json](#inline_composition.request_body.application_json), [request_body.multipart_form_data](#inline_composition.request_body.multipart_form_data), Unset] | optional, default is unset | [query_params](#inline_composition.RequestQueryParameters) | [RequestQueryParameters.Params](#inline_composition.RequestQueryParameters.Params) | | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', 'multipart/form-data', ) | Tells the server the content type(s) that are accepted by the client @@ -1562,9 +1562,9 @@ stream | bool | default is False | if True then the response.content will be str timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1584,7 +1584,7 @@ Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- str, | str, | | -# RequestBody.Schemas.multipart_form_data +# request_body.multipart_form_data ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1791,15 +1791,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#json_form_data.RequestBody) | typing.Union[[RequestBody.Schemas.application_x_www_form_urlencoded](#json_form_data.RequestBody.Schemas.application_x_www_form_urlencoded), Unset] | optional, default is unset | +[body](#json_form_data.request_body) | typing.Union[[request_body.application_x_www_form_urlencoded](#json_form_data.request_body.application_x_www_form_urlencoded), Unset] | optional, default is unset | content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_x_www_form_urlencoded +# request_body.application_x_www_form_urlencoded ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1874,15 +1874,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#json_patch.RequestBody) | typing.Union[[RequestBody.Schemas.application_json_patchjson](#json_patch.RequestBody.Schemas.application_json_patchjson), Unset] | optional, default is unset | +[body](#json_patch.request_body) | typing.Union[[request_body.application_json_patchjson](#json_patch.request_body.application_json_patchjson), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json-patch+json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json_patchjson +# request_body.application_json_patchjson Type | Description | Notes ------------- | ------------- | ------------- [**JSONPatchRequest**](../../models/JSONPatchRequest.md) | | @@ -1945,16 +1945,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#json_with_charset.RequestBody) | typing.Union[[RequestBody.Schemas.application_json_charsetutf_8](#json_with_charset.RequestBody.Schemas.application_json_charsetutf_8), Unset] | optional, default is unset | +[body](#json_with_charset.request_body) | typing.Union[[request_body.application_json_charsetutf_8](#json_with_charset.request_body.application_json_charsetutf_8), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json; charset=utf-8' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json; charset=utf-8', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json_charsetutf_8 +# request_body.application_json_charsetutf_8 ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -2030,16 +2030,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#mammal.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#mammal.RequestBody.Schemas.application_json)] | required | +[body](#mammal.request_body) | typing.Union[[request_body.application_json](#mammal.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Mammal**](../../models/Mammal.md) | | @@ -2109,16 +2109,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#number_with_validations.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#number_with_validations.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#number_with_validations.request_body) | typing.Union[[request_body.application_json](#number_with_validations.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**NumberWithValidations**](../../models/NumberWithValidations.md) | | @@ -2278,16 +2278,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#object_model_with_ref_props.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#object_model_with_ref_props.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#object_model_with_ref_props.request_body) | typing.Union[[request_body.application_json](#object_model_with_ref_props.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**ObjectModelWithRefProps**](../../models/ObjectModelWithRefProps.md) | | @@ -2413,7 +2413,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#parameter_collisions.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#parameter_collisions.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#parameter_collisions.request_body) | typing.Union[[request_body.application_json](#parameter_collisions.request_body.application_json), Unset] | optional, default is unset | [query_params](#parameter_collisions.RequestQueryParameters) | [RequestQueryParameters.Params](#parameter_collisions.RequestQueryParameters.Params) | | [header_params](#parameter_collisions.RequestHeaderParameters) | [RequestHeaderParameters.Params](#parameter_collisions.RequestHeaderParameters.Params) | | [path_params](#parameter_collisions.RequestPathParameters) | [RequestPathParameters.Params](#parameter_collisions.RequestPathParameters.Params) | | @@ -2424,9 +2424,9 @@ stream | bool | default is False | if True then the response.content will be str timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -3045,16 +3045,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#string.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#string.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#string.request_body) | typing.Union[[request_body.application_json](#string.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**String**](../../models/String.md) | | @@ -3124,16 +3124,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#string_enum.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#string_enum.RequestBody.Schemas.application_json), Unset] | optional, default is unset | +[body](#string_enum.request_body) | typing.Union[[request_body.application_json](#string_enum.request_body.application_json), Unset] | optional, default is unset | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**StringEnum**](../../models/StringEnum.md) | | @@ -3202,16 +3202,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#upload_download_file.RequestBody) | typing.Union[[RequestBody.Schemas.application_octet_stream](#upload_download_file.RequestBody.Schemas.application_octet_stream)] | required | +[body](#upload_download_file.request_body) | typing.Union[[request_body.application_octet_stream](#upload_download_file.request_body.application_octet_stream)] | required | content_type | str | optional, default is 'application/octet-stream' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/octet-stream', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_octet_stream +# request_body.application_octet_stream file to upload @@ -3289,16 +3289,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#upload_file.RequestBody) | typing.Union[[RequestBody.Schemas.multipart_form_data](#upload_file.RequestBody.Schemas.multipart_form_data), Unset] | optional, default is unset | +[body](#upload_file.request_body) | typing.Union[[request_body.multipart_form_data](#upload_file.request_body.multipart_form_data), Unset] | optional, default is unset | content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.multipart_form_data +# request_body.multipart_form_data ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -3379,16 +3379,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#upload_files.RequestBody) | typing.Union[[RequestBody.Schemas.multipart_form_data](#upload_files.RequestBody.Schemas.multipart_form_data), Unset] | optional, default is unset | +[body](#upload_files.request_body) | typing.Union[[request_body.multipart_form_data](#upload_files.request_body.multipart_form_data), Unset] | optional, default is unset | content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.multipart_form_data +# request_body.multipart_form_data ## Model Type Info Input Type | Accessed Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md index 8a5209ae4db..70ab394877f 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md @@ -60,16 +60,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#classname.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#classname.RequestBody.Schemas.application_json)] | required | +[body](#classname.request_body) | typing.Union[[request_body.application_json](#classname.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Client**](../../models/Client.md) | | diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md index 99c7f45ca94..ddd5855f10e 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md @@ -142,22 +142,22 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#add_pet.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#add_pet.RequestBody.Schemas.application_json), [RequestBody.Schemas.application_xml](#add_pet.RequestBody.Schemas.application_xml)] | required | +[body](#add_pet.request_body) | typing.Union[[request_body.application_json](#add_pet.request_body.application_json), [request_body.application_xml](#add_pet.request_body.application_xml)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body host_index | typing.Optional[int] | default is None | Allows one to select a different host stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Pet**](../../models/Pet.md) | | -# RequestBody.Schemas.application_xml +# request_body.application_xml Type | Description | Notes ------------- | ------------- | ------------- [**Pet**](../../models/Pet.md) | | @@ -942,22 +942,22 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#update_pet.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#update_pet.RequestBody.Schemas.application_json), [RequestBody.Schemas.application_xml](#update_pet.RequestBody.Schemas.application_xml)] | required | +[body](#update_pet.request_body) | typing.Union[[request_body.application_json](#update_pet.request_body.application_json), [request_body.application_xml](#update_pet.request_body.application_xml)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body host_index | typing.Optional[int] | default is None | Allows one to select a different host stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Pet**](../../models/Pet.md) | | -# RequestBody.Schemas.application_xml +# request_body.application_xml Type | Description | Notes ------------- | ------------- | ------------- [**Pet**](../../models/Pet.md) | | @@ -1065,16 +1065,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#update_pet_with_form.RequestBody) | typing.Union[[RequestBody.Schemas.application_x_www_form_urlencoded](#update_pet_with_form.RequestBody.Schemas.application_x_www_form_urlencoded), Unset] | optional, default is unset | +[body](#update_pet_with_form.request_body) | typing.Union[[request_body.application_x_www_form_urlencoded](#update_pet_with_form.request_body.application_x_www_form_urlencoded), Unset] | optional, default is unset | [path_params](#update_pet_with_form.RequestPathParameters) | [RequestPathParameters.Params](#update_pet_with_form.RequestPathParameters.Params) | | content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_x_www_form_urlencoded +# request_body.application_x_www_form_urlencoded ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1190,7 +1190,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#upload_file_with_required_file.RequestBody) | typing.Union[[RequestBody.Schemas.multipart_form_data](#upload_file_with_required_file.RequestBody.Schemas.multipart_form_data), Unset] | optional, default is unset | +[body](#upload_file_with_required_file.request_body) | typing.Union[[request_body.multipart_form_data](#upload_file_with_required_file.request_body.multipart_form_data), Unset] | optional, default is unset | [path_params](#upload_file_with_required_file.RequestPathParameters) | [RequestPathParameters.Params](#upload_file_with_required_file.RequestPathParameters.Params) | | content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client @@ -1198,9 +1198,9 @@ stream | bool | default is False | if True then the response.content will be str timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.multipart_form_data +# request_body.multipart_form_data ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -1322,7 +1322,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#upload_image.RequestBody) | typing.Union[[RequestBody.Schemas.multipart_form_data](#upload_image.RequestBody.Schemas.multipart_form_data), Unset] | optional, default is unset | +[body](#upload_image.request_body) | typing.Union[[request_body.multipart_form_data](#upload_image.request_body.multipart_form_data), Unset] | optional, default is unset | [path_params](#upload_image.RequestPathParameters) | [RequestPathParameters.Params](#upload_image.RequestPathParameters.Params) | | content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client @@ -1330,9 +1330,9 @@ stream | bool | default is False | if True then the response.content will be str timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.multipart_form_data +# request_body.multipart_form_data ## Model Type Info Input Type | Accessed Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md index c8fca2b4465..f66bfcf1dac 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md @@ -329,16 +329,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#place_order.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#place_order.RequestBody.Schemas.application_json)] | required | +[body](#place_order.request_body) | typing.Union[[request_body.application_json](#place_order.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**Order**](../../models/Order.md) | | diff --git a/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md index 8dad09635c9..0ac7d426b37 100644 --- a/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md @@ -67,15 +67,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#create_user.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#create_user.RequestBody.Schemas.application_json)] | required | +[body](#create_user.request_body) | typing.Union[[request_body.application_json](#create_user.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**User**](../../models/User.md) | | @@ -154,15 +154,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#create_users_with_array_input.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#create_users_with_array_input.RequestBody.Schemas.application_json)] | required | +[body](#create_users_with_array_input.request_body) | typing.Union[[request_body.application_json](#create_users_with_array_input.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -247,15 +247,15 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#create_users_with_list_input.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#create_users_with_list_input.RequestBody.Schemas.application_json)] | required | +[body](#create_users_with_list_input.request_body) | typing.Union[[request_body.application_json](#create_users_with_list_input.request_body.application_json)] | required | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -726,16 +726,16 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -[body](#update_user.RequestBody) | typing.Union[[RequestBody.Schemas.application_json](#update_user.RequestBody.Schemas.application_json)] | required | +[body](#update_user.request_body) | typing.Union[[request_body.application_json](#update_user.request_body.application_json)] | required | [path_params](#update_user.RequestPathParameters) | [RequestPathParameters.Params](#update_user.RequestPathParameters.Params) | | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body +### body -# RequestBody.Schemas.application_json +# request_body.application_json Type | Description | Notes ------------- | ------------- | ------------- [**User**](../../models/User.md) | | diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py index cc0b963ae49..e900456505b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +44,7 @@ class BaseApi(api_client.Api): @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -70,7 +57,7 @@ def _call_123_test_special_tags_oapg( @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -84,7 +71,7 @@ def _call_123_test_special_tags_oapg( @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -95,7 +82,7 @@ def _call_123_test_special_tags_oapg( @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -108,7 +95,7 @@ def _call_123_test_special_tags_oapg( def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -134,7 +121,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -171,7 +158,7 @@ class Call123TestSpecialTags(BaseApi): @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -184,7 +171,7 @@ def call_123_test_special_tags( @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -198,7 +185,7 @@ def call_123_test_special_tags( @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -209,7 +196,7 @@ def call_123_test_special_tags( @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -222,7 +209,7 @@ def call_123_test_special_tags( def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -245,7 +232,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -258,7 +245,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -272,7 +259,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -283,7 +270,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -296,7 +283,7 @@ def patch( def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi index dd08623d0c0..1a5cd51dba2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi @@ -28,21 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +39,7 @@ class BaseApi(api_client.Api): @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -65,7 +52,7 @@ class BaseApi(api_client.Api): @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -79,7 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -90,7 +77,7 @@ class BaseApi(api_client.Api): @typing.overload def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -103,7 +90,7 @@ class BaseApi(api_client.Api): def _call_123_test_special_tags_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -129,7 +116,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -166,7 +153,7 @@ class Call123TestSpecialTags(BaseApi): @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -179,7 +166,7 @@ class Call123TestSpecialTags(BaseApi): @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -193,7 +180,7 @@ class Call123TestSpecialTags(BaseApi): @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -204,7 +191,7 @@ class Call123TestSpecialTags(BaseApi): @typing.overload def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -217,7 +204,7 @@ class Call123TestSpecialTags(BaseApi): def call_123_test_special_tags( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -240,7 +227,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -253,7 +240,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -267,7 +254,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -278,7 +265,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -291,7 +278,7 @@ class ApiForpatch(BaseApi): def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/request_body.py new file mode 100644 index 00000000000..3dbb4adeeac --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + + +application_json = Client + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py index 30c37126489..089c8ac98dc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py @@ -28,6 +28,7 @@ from .. import path from . import response_for_200 from . import response_for_404 +from . import request_body @@ -300,145 +301,6 @@ class Params(RequiredParams, OptionalParams): schema=Schemas.enum_header_string, ), ] - -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class enum_form_string_array( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">": "GREATER_THAN", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'enum_form_string_array': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class enum_form_string( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - __annotations__ = { - "enum_form_string_array": enum_form_string_array, - "enum_form_string": enum_form_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[MetaOapg.properties.enum_form_string_array, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[MetaOapg.properties.enum_form_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, list, tuple, schemas.Unset] = schemas.unset, - enum_form_string: typing.Union[MetaOapg.properties.enum_form_string, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - enum_form_string_array=enum_form_string_array, - enum_form_string=enum_form_string, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, '404': response_for_404.response, @@ -450,7 +312,7 @@ class BaseApi(api_client.Api): def _enum_parameters_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -464,7 +326,7 @@ def _enum_parameters_oapg( def _enum_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -480,7 +342,7 @@ def _enum_parameters_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -491,7 +353,7 @@ def _enum_parameters_oapg( def _enum_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -505,7 +367,7 @@ def _enum_parameters_oapg( def _enum_parameters_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -545,7 +407,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -583,7 +445,7 @@ class EnumParameters(BaseApi): def enum_parameters( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -597,7 +459,7 @@ def enum_parameters( def enum_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -613,7 +475,7 @@ def enum_parameters( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -624,7 +486,7 @@ def enum_parameters( def enum_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -638,7 +500,7 @@ def enum_parameters( def enum_parameters( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -663,7 +525,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -677,7 +539,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -693,7 +555,7 @@ def get( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -704,7 +566,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -718,7 +580,7 @@ def get( def get( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi index 868e35ada86..1a758ace312 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi @@ -27,6 +27,7 @@ from petstore_api import schemas # noqa: F401 from . import response_for_200 from . import response_for_404 +from . import request_body @@ -254,136 +255,12 @@ class RequestHeaderParameters: ), ] -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class enum_form_string_array( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def GREATER_THAN(cls): - return cls(">") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'enum_form_string_array': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class enum_form_string( - schemas.EnumBase, - schemas.StrSchema - ): - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - __annotations__ = { - "enum_form_string_array": enum_form_string_array, - "enum_form_string": enum_form_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[MetaOapg.properties.enum_form_string_array, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[MetaOapg.properties.enum_form_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, list, tuple, schemas.Unset] = schemas.unset, - enum_form_string: typing.Union[MetaOapg.properties.enum_form_string, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - enum_form_string_array=enum_form_string_array, - enum_form_string=enum_form_string, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _enum_parameters_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -397,7 +274,7 @@ class BaseApi(api_client.Api): def _enum_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -413,7 +290,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -424,7 +301,7 @@ class BaseApi(api_client.Api): def _enum_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -438,7 +315,7 @@ class BaseApi(api_client.Api): def _enum_parameters_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -478,7 +355,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -516,7 +393,7 @@ class EnumParameters(BaseApi): def enum_parameters( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -530,7 +407,7 @@ class EnumParameters(BaseApi): def enum_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -546,7 +423,7 @@ class EnumParameters(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -557,7 +434,7 @@ class EnumParameters(BaseApi): def enum_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -571,7 +448,7 @@ class EnumParameters(BaseApi): def enum_parameters( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -596,7 +473,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -610,7 +487,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -626,7 +503,7 @@ class ApiForget(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -637,7 +514,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -651,7 +528,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body.py new file mode 100644 index 00000000000..242a0a9bb67 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_x_www_form_urlencoded( + schemas.DictSchema +): + + + class MetaOapg: + + class properties: + + + class enum_form_string_array( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + ">": "GREATER_THAN", + "$": "DOLLAR", + } + + @schemas.classproperty + def GREATER_THAN(cls): + return cls(">") + + @schemas.classproperty + def DOLLAR(cls): + return cls("$") + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'enum_form_string_array': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class enum_form_string( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def EFG(cls): + return cls("-efg") + + @schemas.classproperty + def XYZ(cls): + return cls("(xyz)") + __annotations__ = { + "enum_form_string_array": enum_form_string_array, + "enum_form_string": enum_form_string, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string_array"]) -> typing.Union[MetaOapg.properties.enum_form_string_array, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_form_string"]) -> typing.Union[MetaOapg.properties.enum_form_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_form_string_array", "enum_form_string", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, list, tuple, schemas.Unset] = schemas.unset, + enum_form_string: typing.Union[MetaOapg.properties.enum_form_string, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'application_x_www_form_urlencoded': + return super().__new__( + cls, + *args, + enum_form_string_array=enum_form_string_array, + enum_form_string=enum_form_string, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=application_x_www_form_urlencoded + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py index 1d1e09ef194..ccbf1ed435f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +44,7 @@ class BaseApi(api_client.Api): @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -70,7 +57,7 @@ def _client_model_oapg( @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -84,7 +71,7 @@ def _client_model_oapg( @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -95,7 +82,7 @@ def _client_model_oapg( @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -108,7 +95,7 @@ def _client_model_oapg( def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -134,7 +121,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -171,7 +158,7 @@ class ClientModel(BaseApi): @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -184,7 +171,7 @@ def client_model( @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -198,7 +185,7 @@ def client_model( @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -209,7 +196,7 @@ def client_model( @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -222,7 +209,7 @@ def client_model( def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -245,7 +232,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -258,7 +245,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -272,7 +259,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -283,7 +270,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -296,7 +283,7 @@ def patch( def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi index 283730f5c31..7d0b9305f40 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi @@ -28,21 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +39,7 @@ class BaseApi(api_client.Api): @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -65,7 +52,7 @@ class BaseApi(api_client.Api): @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -79,7 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -90,7 +77,7 @@ class BaseApi(api_client.Api): @typing.overload def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -103,7 +90,7 @@ class BaseApi(api_client.Api): def _client_model_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -129,7 +116,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -166,7 +153,7 @@ class ClientModel(BaseApi): @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -179,7 +166,7 @@ class ClientModel(BaseApi): @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -193,7 +180,7 @@ class ClientModel(BaseApi): @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -204,7 +191,7 @@ class ClientModel(BaseApi): @typing.overload def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -217,7 +204,7 @@ class ClientModel(BaseApi): def client_model( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -240,7 +227,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -253,7 +240,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -267,7 +254,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -278,7 +265,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -291,7 +278,7 @@ class ApiForpatch(BaseApi): def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/request_body.py new file mode 100644 index 00000000000..3dbb4adeeac --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + + +application_json = Client + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py index e0009ba7a67..1667278108e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py @@ -28,289 +28,9 @@ from .. import path from . import response_for_200 from . import response_for_404 +from . import request_body - -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "number", - "pattern_without_delimiter", - "byte", - "double", - } - - class properties: - - - class integer( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_maximum = 100 - inclusive_minimum = 10 - - - class int32( - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - inclusive_maximum = 200 - inclusive_minimum = 20 - int64 = schemas.Int64Schema - - - class number( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 543.2 - inclusive_minimum = 32.1 - - - class _float( - schemas.Float32Schema - ): - - - class MetaOapg: - format = 'float' - inclusive_maximum = 987.6 - - - class double( - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - inclusive_maximum = 123.4 - inclusive_minimum = 67.8 - - - class string( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'[a-z]', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - - - class pattern_without_delimiter( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[A-Z].*', # noqa: E501 - }] - byte = schemas.StrSchema - binary = schemas.BinarySchema - date = schemas.DateSchema - dateTime = schemas.DateTimeSchema - - - class password( - schemas.StrSchema - ): - - - class MetaOapg: - format = 'password' - max_length = 64 - min_length = 10 - callback = schemas.StrSchema - __annotations__ = { - "integer": integer, - "int32": int32, - "int64": int64, - "number": number, - "float": _float, - "double": double, - "string": string, - "pattern_without_delimiter": pattern_without_delimiter, - "byte": byte, - "binary": binary, - "date": date, - "dateTime": dateTime, - "password": password, - "callback": callback, - } - - number: MetaOapg.properties.number - pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter - byte: MetaOapg.properties.byte - double: MetaOapg.properties.double - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["callback"]) -> MetaOapg.properties.callback: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["callback"]) -> typing.Union[MetaOapg.properties.callback, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - pattern_without_delimiter: typing.Union[MetaOapg.properties.pattern_without_delimiter, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, str, date, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - callback: typing.Union[MetaOapg.properties.callback, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - number=number, - pattern_without_delimiter=pattern_without_delimiter, - byte=byte, - double=double, - integer=integer, - int32=int32, - int64=int64, - string=string, - binary=binary, - date=date, - dateTime=dateTime, - password=password, - callback=callback, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - _auth = [ 'http_basic_test', ] @@ -326,7 +46,7 @@ class BaseApi(api_client.Api): def _endpoint_parameters_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -338,7 +58,7 @@ def _endpoint_parameters_oapg( def _endpoint_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -352,7 +72,7 @@ def _endpoint_parameters_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -361,7 +81,7 @@ def _endpoint_parameters_oapg( def _endpoint_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -373,7 +93,7 @@ def _endpoint_parameters_oapg( def _endpoint_parameters_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -392,7 +112,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -431,7 +151,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -443,7 +163,7 @@ def endpoint_parameters( def endpoint_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -457,7 +177,7 @@ def endpoint_parameters( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -466,7 +186,7 @@ def endpoint_parameters( def endpoint_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -478,7 +198,7 @@ def endpoint_parameters( def endpoint_parameters( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -499,7 +219,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -511,7 +231,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -525,7 +245,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -534,7 +254,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -546,7 +266,7 @@ def post( def post( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi index be606039c19..5dacc717956 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi @@ -27,256 +27,16 @@ from petstore_api import schemas # noqa: F401 from . import response_for_200 from . import response_for_404 +from . import request_body -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "number", - "pattern_without_delimiter", - "byte", - "double", - } - - class properties: - - - class integer( - schemas.IntSchema - ): - pass - - - class int32( - schemas.Int32Schema - ): - pass - int64 = schemas.Int64Schema - - - class number( - schemas.NumberSchema - ): - pass - - - class _float( - schemas.Float32Schema - ): - pass - - - class double( - schemas.Float64Schema - ): - pass - - - class string( - schemas.StrSchema - ): - pass - - - class pattern_without_delimiter( - schemas.StrSchema - ): - pass - byte = schemas.StrSchema - binary = schemas.BinarySchema - date = schemas.DateSchema - dateTime = schemas.DateTimeSchema - - - class password( - schemas.StrSchema - ): - pass - callback = schemas.StrSchema - __annotations__ = { - "integer": integer, - "int32": int32, - "int64": int64, - "number": number, - "float": _float, - "double": double, - "string": string, - "pattern_without_delimiter": pattern_without_delimiter, - "byte": byte, - "binary": binary, - "date": date, - "dateTime": dateTime, - "password": password, - "callback": callback, - } - - number: MetaOapg.properties.number - pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter - byte: MetaOapg.properties.byte - double: MetaOapg.properties.double - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["callback"]) -> MetaOapg.properties.callback: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["callback"]) -> typing.Union[MetaOapg.properties.callback, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - pattern_without_delimiter: typing.Union[MetaOapg.properties.pattern_without_delimiter, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - date: typing.Union[MetaOapg.properties.date, str, date, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - callback: typing.Union[MetaOapg.properties.callback, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - number=number, - pattern_without_delimiter=pattern_without_delimiter, - byte=byte, - double=double, - integer=integer, - int32=int32, - int64=int64, - string=string, - binary=binary, - date=date, - dateTime=dateTime, - password=password, - callback=callback, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _endpoint_parameters_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -288,7 +48,7 @@ class BaseApi(api_client.Api): def _endpoint_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -302,7 +62,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -311,7 +71,7 @@ class BaseApi(api_client.Api): def _endpoint_parameters_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -323,7 +83,7 @@ class BaseApi(api_client.Api): def _endpoint_parameters_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -342,7 +102,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -381,7 +141,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -393,7 +153,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -407,7 +167,7 @@ class EndpointParameters(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -416,7 +176,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -428,7 +188,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -449,7 +209,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -461,7 +221,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -475,7 +235,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -484,7 +244,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -496,7 +256,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body.py new file mode 100644 index 00000000000..fcc49839ebb --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_x_www_form_urlencoded( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "number", + "pattern_without_delimiter", + "byte", + "double", + } + + class properties: + + + class integer( + schemas.IntSchema + ): + + + class MetaOapg: + inclusive_maximum = 100 + inclusive_minimum = 10 + + + class int32( + schemas.Int32Schema + ): + + + class MetaOapg: + format = 'int32' + inclusive_maximum = 200 + inclusive_minimum = 20 + int64 = schemas.Int64Schema + + + class number( + schemas.NumberSchema + ): + + + class MetaOapg: + inclusive_maximum = 543.2 + inclusive_minimum = 32.1 + + + class _float( + schemas.Float32Schema + ): + + + class MetaOapg: + format = 'float' + inclusive_maximum = 987.6 + + + class double( + schemas.Float64Schema + ): + + + class MetaOapg: + format = 'double' + inclusive_maximum = 123.4 + inclusive_minimum = 67.8 + + + class string( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }] + + + class pattern_without_delimiter( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'^[A-Z].*', # noqa: E501 + }] + byte = schemas.StrSchema + binary = schemas.BinarySchema + date = schemas.DateSchema + dateTime = schemas.DateTimeSchema + + + class password( + schemas.StrSchema + ): + + + class MetaOapg: + format = 'password' + max_length = 64 + min_length = 10 + callback = schemas.StrSchema + __annotations__ = { + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": _float, + "double": double, + "string": string, + "pattern_without_delimiter": pattern_without_delimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, + } + + number: MetaOapg.properties.number + pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter + byte: MetaOapg.properties.byte + double: MetaOapg.properties.double + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["callback"]) -> MetaOapg.properties.callback: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> typing.Union[MetaOapg.properties.date, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["callback"]) -> typing.Union[MetaOapg.properties.callback, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer", "int32", "int64", "number", "float", "double", "string", "pattern_without_delimiter", "byte", "binary", "date", "dateTime", "password", "callback", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], + pattern_without_delimiter: typing.Union[MetaOapg.properties.pattern_without_delimiter, str, ], + byte: typing.Union[MetaOapg.properties.byte, str, ], + double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, ], + integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, + string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, + binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + date: typing.Union[MetaOapg.properties.date, str, date, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, + password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, + callback: typing.Union[MetaOapg.properties.callback, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'application_x_www_form_urlencoded': + return super().__new__( + cls, + *args, + number=number, + pattern_without_delimiter=pattern_without_delimiter, + byte=byte, + double=double, + integer=integer, + int32=int32, + int64=int64, + string=string, + binary=binary, + date=date, + dateTime=dateTime, + password=password, + callback=callback, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=application_x_www_form_urlencoded + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py index 936e93b4ebc..ae4cbd77aa9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AdditionalPropertiesWithArrayOfEnums - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _additional_properties_with_array_of_enums_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _additional_properties_with_array_of_enums_oapg( def _additional_properties_with_array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _additional_properties_with_array_of_enums_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _additional_properties_with_array_of_enums_oapg( def _additional_properties_with_array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _additional_properties_with_array_of_enums_oapg( def _additional_properties_with_array_of_enums_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -131,7 +119,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -169,7 +157,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): def additional_properties_with_array_of_enums( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -182,7 +170,7 @@ def additional_properties_with_array_of_enums( def additional_properties_with_array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,7 +185,7 @@ def additional_properties_with_array_of_enums( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -207,7 +195,7 @@ def additional_properties_with_array_of_enums( def additional_properties_with_array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -220,7 +208,7 @@ def additional_properties_with_array_of_enums( def additional_properties_with_array_of_enums( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -243,7 +231,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -256,7 +244,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -271,7 +259,7 @@ def get( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -281,7 +269,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -294,7 +282,7 @@ def get( def get( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi index 99b50077623..e42e3053bb9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = AdditionalPropertiesWithArrayOfEnums - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _additional_properties_with_array_of_enums_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _additional_properties_with_array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _additional_properties_with_array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _additional_properties_with_array_of_enums_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -126,7 +114,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -164,7 +152,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): def additional_properties_with_array_of_enums( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -177,7 +165,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): def additional_properties_with_array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,7 +180,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -202,7 +190,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): def additional_properties_with_array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -215,7 +203,7 @@ class AdditionalPropertiesWithArrayOfEnums(BaseApi): def additional_properties_with_array_of_enums( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -238,7 +226,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -251,7 +239,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -266,7 +254,7 @@ class ApiForget(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -276,7 +264,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -289,7 +277,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body.py new file mode 100644 index 00000000000..734d7ec9f1b --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums + + +application_json = AdditionalPropertiesWithArrayOfEnums + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py index 6c57333639e..5f471517ac7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = FileSchemaTestClass - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _body_with_file_schema_oapg( @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _body_with_file_schema_oapg( @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _body_with_file_schema_oapg( @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _body_with_file_schema_oapg( def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +109,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class BodyWithFileSchema(BaseApi): @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ def body_with_file_schema( @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ def body_with_file_schema( @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ def body_with_file_schema( @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ def body_with_file_schema( def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ def put( def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi index a85d7066ed2..4efc088b123 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi @@ -28,28 +28,15 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.file_schema_test_class import FileSchemaTestClass from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json = FileSchemaTestClass - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _body_with_file_schema_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -117,7 +104,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -154,7 +141,7 @@ class BodyWithFileSchema(BaseApi): @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +153,7 @@ class BodyWithFileSchema(BaseApi): @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +166,7 @@ class BodyWithFileSchema(BaseApi): @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -189,7 +176,7 @@ class BodyWithFileSchema(BaseApi): @typing.overload def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +188,7 @@ class BodyWithFileSchema(BaseApi): def body_with_file_schema( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,7 +209,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,7 +221,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -247,7 +234,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -257,7 +244,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +256,7 @@ class ApiForput(BaseApi): def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body.py new file mode 100644 index 00000000000..9adac84db00 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.file_schema_test_class import FileSchemaTestClass + + +application_json = FileSchemaTestClass + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py index a835e5f4ae5..4daea953f29 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py @@ -29,6 +29,7 @@ from .. import path from . import response_for_200 +from . import request_body @@ -64,20 +65,6 @@ class Params(RequiredParams, OptionalParams): explode=True, ), ] - -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -87,7 +74,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -100,7 +87,7 @@ def _body_with_query_params_oapg( @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -114,7 +101,7 @@ def _body_with_query_params_oapg( @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -125,7 +112,7 @@ def _body_with_query_params_oapg( @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -138,7 +125,7 @@ def _body_with_query_params_oapg( def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -172,7 +159,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -209,7 +196,7 @@ class BodyWithQueryParams(BaseApi): @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -222,7 +209,7 @@ def body_with_query_params( @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -236,7 +223,7 @@ def body_with_query_params( @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -247,7 +234,7 @@ def body_with_query_params( @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -260,7 +247,7 @@ def body_with_query_params( def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -283,7 +270,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -296,7 +283,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -310,7 +297,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -321,7 +308,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -334,7 +321,7 @@ def put( def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi index 9a02a9d2949..36ece9e394e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi @@ -28,6 +28,7 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User from . import response_for_200 +from . import request_body @@ -64,25 +65,11 @@ class RequestQueryParameters: ), ] -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -95,7 +82,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -109,7 +96,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -120,7 +107,7 @@ class BaseApi(api_client.Api): @typing.overload def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -133,7 +120,7 @@ class BaseApi(api_client.Api): def _body_with_query_params_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -167,7 +154,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -204,7 +191,7 @@ class BodyWithQueryParams(BaseApi): @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -217,7 +204,7 @@ class BodyWithQueryParams(BaseApi): @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -231,7 +218,7 @@ class BodyWithQueryParams(BaseApi): @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -242,7 +229,7 @@ class BodyWithQueryParams(BaseApi): @typing.overload def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -255,7 +242,7 @@ class BodyWithQueryParams(BaseApi): def body_with_query_params( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -278,7 +265,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -291,7 +278,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -305,7 +292,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), @@ -316,7 +303,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -329,7 +316,7 @@ class ApiForput(BaseApi): def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', query_params: RequestQueryParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body.py new file mode 100644 index 00000000000..44bdfbbd588 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + + +application_json = User + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py index 06f74fc57fd..a3bb4cd7f4b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _auth = [ 'api_key_query', ] @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -74,7 +61,7 @@ def _classname_oapg( @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -88,7 +75,7 @@ def _classname_oapg( @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -99,7 +86,7 @@ def _classname_oapg( @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -112,7 +99,7 @@ def _classname_oapg( def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -138,7 +125,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -176,7 +163,7 @@ class Classname(BaseApi): @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -189,7 +176,7 @@ def classname( @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -203,7 +190,7 @@ def classname( @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -214,7 +201,7 @@ def classname( @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -227,7 +214,7 @@ def classname( def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -250,7 +237,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -263,7 +250,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -277,7 +264,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -288,7 +275,7 @@ def patch( @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -301,7 +288,7 @@ def patch( def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi index 80ea9ec0a3a..a38e2de8811 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi @@ -28,21 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Client - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +39,7 @@ class BaseApi(api_client.Api): @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -65,7 +52,7 @@ class BaseApi(api_client.Api): @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -79,7 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -90,7 +77,7 @@ class BaseApi(api_client.Api): @typing.overload def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -103,7 +90,7 @@ class BaseApi(api_client.Api): def _classname_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -129,7 +116,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -167,7 +154,7 @@ class Classname(BaseApi): @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -180,7 +167,7 @@ class Classname(BaseApi): @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -194,7 +181,7 @@ class Classname(BaseApi): @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -205,7 +192,7 @@ class Classname(BaseApi): @typing.overload def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -218,7 +205,7 @@ class Classname(BaseApi): def classname( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -241,7 +228,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -254,7 +241,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -268,7 +255,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -279,7 +266,7 @@ class ApiForpatch(BaseApi): @typing.overload def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -292,7 +279,7 @@ class ApiForpatch(BaseApi): def patch( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/request_body.py new file mode 100644 index 00000000000..3dbb4adeeac --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + + +application_json = Client + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py index ec6f97d0ed2..d2bdb197a74 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py @@ -27,50 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - - - class application_json( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'application_json': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -80,7 +39,7 @@ class BaseApi(api_client.Api): @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -92,7 +51,7 @@ def _inline_additional_properties_oapg( @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -105,7 +64,7 @@ def _inline_additional_properties_oapg( @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -115,7 +74,7 @@ def _inline_additional_properties_oapg( @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -127,7 +86,7 @@ def _inline_additional_properties_oapg( def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -149,7 +108,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -186,7 +145,7 @@ class InlineAdditionalProperties(BaseApi): @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -198,7 +157,7 @@ def inline_additional_properties( @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -211,7 +170,7 @@ def inline_additional_properties( @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -221,7 +180,7 @@ def inline_additional_properties( @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -233,7 +192,7 @@ def inline_additional_properties( def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -254,7 +213,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -266,7 +225,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -279,7 +238,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -289,7 +248,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -301,7 +260,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi index 33b09504fb4..7e1f3d7ac1c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi @@ -26,56 +26,15 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - - - class application_json( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'application_json': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -87,7 +46,7 @@ class BaseApi(api_client.Api): @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -100,7 +59,7 @@ class BaseApi(api_client.Api): @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -110,7 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -122,7 +81,7 @@ class BaseApi(api_client.Api): def _inline_additional_properties_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -144,7 +103,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -181,7 +140,7 @@ class InlineAdditionalProperties(BaseApi): @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -193,7 +152,7 @@ class InlineAdditionalProperties(BaseApi): @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +165,7 @@ class InlineAdditionalProperties(BaseApi): @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -216,7 +175,7 @@ class InlineAdditionalProperties(BaseApi): @typing.overload def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -228,7 +187,7 @@ class InlineAdditionalProperties(BaseApi): def inline_additional_properties( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -249,7 +208,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -261,7 +220,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +233,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -284,7 +243,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -296,7 +255,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,dict, frozendict.frozendict, ], + body: typing.Union[request_body.application_json,dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body.py new file mode 100644 index 00000000000..028836c4196 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_json( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'application_json': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py index a9eb4d018a0..507f5dc0c48 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py @@ -27,6 +27,7 @@ from .. import path from . import response_for_200 +from . import request_body @@ -206,160 +207,6 @@ class Params(RequiredParams, OptionalParams): explode=True, ), ] - -class RequestBody: - class Schemas: - - - class application_json( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_json': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - - - class MetaOapg: - min_length = 1 - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -374,7 +221,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -388,7 +235,7 @@ def _inline_composition_oapg( def _inline_composition_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -402,7 +249,7 @@ def _inline_composition_oapg( def _inline_composition_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -418,7 +265,7 @@ def _inline_composition_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -429,7 +276,7 @@ def _inline_composition_oapg( def _inline_composition_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -443,7 +290,7 @@ def _inline_composition_oapg( def _inline_composition_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -479,7 +326,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -517,7 +364,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -531,7 +378,7 @@ def inline_composition( def inline_composition( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -545,7 +392,7 @@ def inline_composition( def inline_composition( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -561,7 +408,7 @@ def inline_composition( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -572,7 +419,7 @@ def inline_composition( def inline_composition( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -586,7 +433,7 @@ def inline_composition( def inline_composition( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -611,7 +458,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -625,7 +472,7 @@ def post( def post( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -639,7 +486,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -655,7 +502,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -666,7 +513,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -680,7 +527,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi index 8e4fe6583a6..a417cdc311e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi @@ -26,6 +26,7 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body @@ -198,155 +199,7 @@ class RequestQueryParameters: schema=Schemas.compositionInProperty, explode=True, ), - ] - -class RequestBody: - class Schemas: - - - class application_json( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_json': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class someProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - - - class all_of_0( - schemas.StrSchema - ): - pass - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.all_of_0, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'someProp': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "someProp": someProp, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - someProp=someProp, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) -_all_accept_content_types = ( + ]_all_accept_content_types = ( 'application/json', 'multipart/form-data', ) @@ -357,7 +210,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -371,7 +224,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -385,7 +238,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -401,7 +254,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -412,7 +265,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -426,7 +279,7 @@ class BaseApi(api_client.Api): def _inline_composition_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -462,7 +315,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -500,7 +353,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -514,7 +367,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -528,7 +381,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -544,7 +397,7 @@ class InlineComposition(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -555,7 +408,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -569,7 +422,7 @@ class InlineComposition(BaseApi): def inline_composition( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -594,7 +447,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -608,7 +461,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"], - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -622,7 +475,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -638,7 +491,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -649,7 +502,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -663,7 +516,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/request_body.py new file mode 100644 index 00000000000..c8c41c58099 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/request_body.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_json( + schemas.ComposedSchema, +): + + + class MetaOapg: + + + class all_of_0( + schemas.StrSchema + ): + + + class MetaOapg: + min_length = 1 + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + cls.all_of_0, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'application_json': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +class multipart_form_data( + schemas.DictSchema +): + + + class MetaOapg: + + class properties: + + + class someProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + + + class all_of_0( + schemas.StrSchema + ): + + + class MetaOapg: + min_length = 1 + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + cls.all_of_0, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'someProp': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "someProp": someProp, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["someProp"]) -> typing.Union[MetaOapg.properties.someProp, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["someProp", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'multipart_form_data': + return super().__new__( + cls, + *args, + someProp=someProp, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + 'multipart/form-data': api_client.MediaType( + schema=multipart_form_data + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py index ca1b716630b..e4aabfad0b0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py @@ -27,87 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "param", - "param2", - } - - class properties: - param = schemas.StrSchema - param2 = schemas.StrSchema - __annotations__ = { - "param": param, - "param2": param2, - } - - param: MetaOapg.properties.param - param2: MetaOapg.properties.param2 - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - param: typing.Union[MetaOapg.properties.param, str, ], - param2: typing.Union[MetaOapg.properties.param2, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - param=param, - param2=param2, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -118,7 +40,7 @@ class BaseApi(api_client.Api): def _json_form_data_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -130,7 +52,7 @@ def _json_form_data_oapg( def _json_form_data_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -144,7 +66,7 @@ def _json_form_data_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -153,7 +75,7 @@ def _json_form_data_oapg( def _json_form_data_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -165,7 +87,7 @@ def _json_form_data_oapg( def _json_form_data_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -184,7 +106,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -222,7 +144,7 @@ class JsonFormData(BaseApi): def json_form_data( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -234,7 +156,7 @@ def json_form_data( def json_form_data( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -248,7 +170,7 @@ def json_form_data( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -257,7 +179,7 @@ def json_form_data( def json_form_data( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -269,7 +191,7 @@ def json_form_data( def json_form_data( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -290,7 +212,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -302,7 +224,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -316,7 +238,7 @@ def get( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -325,7 +247,7 @@ def get( def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -337,7 +259,7 @@ def get( def get( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi index 0e2ecdb4462..b127066bed7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi @@ -26,94 +26,16 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "param", - "param2", - } - - class properties: - param = schemas.StrSchema - param2 = schemas.StrSchema - __annotations__ = { - "param": param, - "param2": param2, - } - - param: MetaOapg.properties.param - param2: MetaOapg.properties.param2 - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - param: typing.Union[MetaOapg.properties.param, str, ], - param2: typing.Union[MetaOapg.properties.param2, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - param=param, - param2=param2, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _json_form_data_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -125,7 +47,7 @@ class BaseApi(api_client.Api): def _json_form_data_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -139,7 +61,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -148,7 +70,7 @@ class BaseApi(api_client.Api): def _json_form_data_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -160,7 +82,7 @@ class BaseApi(api_client.Api): def _json_form_data_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -179,7 +101,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -217,7 +139,7 @@ class JsonFormData(BaseApi): def json_form_data( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -229,7 +151,7 @@ class JsonFormData(BaseApi): def json_form_data( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -243,7 +165,7 @@ class JsonFormData(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -252,7 +174,7 @@ class JsonFormData(BaseApi): def json_form_data( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -264,7 +186,7 @@ class JsonFormData(BaseApi): def json_form_data( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -285,7 +207,7 @@ class ApiForget(BaseApi): def get( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -297,7 +219,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -311,7 +233,7 @@ class ApiForget(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -320,7 +242,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -332,7 +254,7 @@ class ApiForget(BaseApi): def get( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body.py new file mode 100644 index 00000000000..1a7bc4a0bc5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_x_www_form_urlencoded( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "param", + "param2", + } + + class properties: + param = schemas.StrSchema + param2 = schemas.StrSchema + __annotations__ = { + "param": param, + "param2": param2, + } + + param: MetaOapg.properties.param + param2: MetaOapg.properties.param2 + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["param"]) -> MetaOapg.properties.param: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["param2"]) -> MetaOapg.properties.param2: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["param", "param2", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + param: typing.Union[MetaOapg.properties.param, str, ], + param2: typing.Union[MetaOapg.properties.param2, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'application_x_www_form_urlencoded': + return super().__new__( + cls, + *args, + param=param, + param2=param2, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=application_x_www_form_urlencoded + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py index b653e5f7946..c0dbecc4f4f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json_patchjson = JSONPatchRequest - - parameter = api_client.RequestBody( - content={ - 'application/json-patch+json': api_client.MediaType( - schema=Schemas.application_json_patchjson - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -54,7 +42,7 @@ class BaseApi(api_client.Api): def _json_patch_oapg( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -66,7 +54,7 @@ def _json_patch_oapg( def _json_patch_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -80,7 +68,7 @@ def _json_patch_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -89,7 +77,7 @@ def _json_patch_oapg( def _json_patch_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -101,7 +89,7 @@ def _json_patch_oapg( def _json_patch_oapg( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -120,7 +108,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -158,7 +146,7 @@ class JsonPatch(BaseApi): def json_patch( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -170,7 +158,7 @@ def json_patch( def json_patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -184,7 +172,7 @@ def json_patch( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -193,7 +181,7 @@ def json_patch( def json_patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -205,7 +193,7 @@ def json_patch( def json_patch( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -226,7 +214,7 @@ class ApiForpatch(BaseApi): def patch( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -238,7 +226,7 @@ def patch( def patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -252,7 +240,7 @@ def patch( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -261,7 +249,7 @@ def patch( def patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -273,7 +261,7 @@ def patch( def patch( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi index 2c41d512575..9c6f437c039 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi @@ -28,28 +28,16 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.json_patch_request import JSONPatchRequest from . import response_for_200 +from . import request_body -class RequestBody: - class Schemas: - application_json_patchjson = JSONPatchRequest - - parameter = api_client.RequestBody( - content={ - 'application/json-patch+json': api_client.MediaType( - schema=Schemas.application_json_patchjson - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _json_patch_oapg( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -61,7 +49,7 @@ class BaseApi(api_client.Api): def _json_patch_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -75,7 +63,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -84,7 +72,7 @@ class BaseApi(api_client.Api): def _json_patch_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -96,7 +84,7 @@ class BaseApi(api_client.Api): def _json_patch_oapg( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -115,7 +103,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -153,7 +141,7 @@ class JsonPatch(BaseApi): def json_patch( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -165,7 +153,7 @@ class JsonPatch(BaseApi): def json_patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -179,7 +167,7 @@ class JsonPatch(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -188,7 +176,7 @@ class JsonPatch(BaseApi): def json_patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -200,7 +188,7 @@ class JsonPatch(BaseApi): def json_patch( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -221,7 +209,7 @@ class ApiForpatch(BaseApi): def patch( self, content_type: typing_extensions.Literal["application/json-patch+json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -233,7 +221,7 @@ class ApiForpatch(BaseApi): def patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -247,7 +235,7 @@ class ApiForpatch(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -256,7 +244,7 @@ class ApiForpatch(BaseApi): def patch( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -268,7 +256,7 @@ class ApiForpatch(BaseApi): def patch( self, content_type: str = 'application/json-patch+json', - body: typing.Union[RequestBody.Schemas.application_json_patchjson, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_patchjson, schemas.Unset] = schemas.unset, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body.py new file mode 100644 index 00000000000..083c8782001 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.json_patch_request import JSONPatchRequest + + +application_json_patchjson = JSONPatchRequest + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json-patch+json': api_client.MediaType( + schema=application_json_patchjson + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py index 26d8b9a3062..6451c71cc23 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py @@ -27,21 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json_charsetutf_8 = schemas.AnyTypeSchema - - parameter = api_client.RequestBody( - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=Schemas.application_json_charsetutf_8 - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -55,7 +43,7 @@ class BaseApi(api_client.Api): def _json_with_charset_oapg( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -68,7 +56,7 @@ def _json_with_charset_oapg( def _json_with_charset_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -83,7 +71,7 @@ def _json_with_charset_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -93,7 +81,7 @@ def _json_with_charset_oapg( def _json_with_charset_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -106,7 +94,7 @@ def _json_with_charset_oapg( def _json_with_charset_oapg( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -129,7 +117,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -167,7 +155,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -180,7 +168,7 @@ def json_with_charset( def json_with_charset( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,7 +183,7 @@ def json_with_charset( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -205,7 +193,7 @@ def json_with_charset( def json_with_charset( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -218,7 +206,7 @@ def json_with_charset( def json_with_charset( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -241,7 +229,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -254,7 +242,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +257,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -279,7 +267,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -292,7 +280,7 @@ def post( def post( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi index 0721d26e50d..493a6f779a4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi @@ -26,20 +26,8 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json_charsetutf_8 = schemas.AnyTypeSchema - - parameter = api_client.RequestBody( - content={ - 'application/json; charset=utf-8': api_client.MediaType( - schema=Schemas.application_json_charsetutf_8 - ), - }, - ) _all_accept_content_types = ( 'application/json; charset=utf-8', ) @@ -50,7 +38,7 @@ class BaseApi(api_client.Api): def _json_with_charset_oapg( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -63,7 +51,7 @@ class BaseApi(api_client.Api): def _json_with_charset_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -78,7 +66,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -88,7 +76,7 @@ class BaseApi(api_client.Api): def _json_with_charset_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +89,7 @@ class BaseApi(api_client.Api): def _json_with_charset_oapg( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -124,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -162,7 +150,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -175,7 +163,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,7 +178,7 @@ class JsonWithCharset(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -200,7 +188,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -213,7 +201,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -236,7 +224,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json; charset=utf-8"] = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -249,7 +237,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -264,7 +252,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +262,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -287,7 +275,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json; charset=utf-8', - body: typing.Union[RequestBody.Schemas.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json_charsetutf_8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body.py new file mode 100644 index 00000000000..5714a9ed8af --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +application_json_charsetutf_8 = schemas.AnyTypeSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json; charset=utf-8': api_client.MediaType( + schema=application_json_charsetutf_8 + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py index 1a4b068d367..5f7c7283d76 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py @@ -27,6 +27,7 @@ from .. import path from . import response_for_200 +from . import request_body @@ -273,19 +274,6 @@ class Params(RequiredParams, OptionalParams): explode=True, ), ] - -class RequestBody: - class Schemas: - application_json = schemas.AnyTypeSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -299,7 +287,7 @@ class BaseApi(api_client.Api): def _parameter_collisions_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -316,7 +304,7 @@ def _parameter_collisions_oapg( def _parameter_collisions_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -335,7 +323,7 @@ def _parameter_collisions_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -349,7 +337,7 @@ def _parameter_collisions_oapg( def _parameter_collisions_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -366,7 +354,7 @@ def _parameter_collisions_oapg( def _parameter_collisions_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -425,7 +413,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -463,7 +451,7 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -480,7 +468,7 @@ def parameter_collisions( def parameter_collisions( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -499,7 +487,7 @@ def parameter_collisions( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -513,7 +501,7 @@ def parameter_collisions( def parameter_collisions( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -530,7 +518,7 @@ def parameter_collisions( def parameter_collisions( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -561,7 +549,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -578,7 +566,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -597,7 +585,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -611,7 +599,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -628,7 +616,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi index dd9f036348f..669f09c405f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi @@ -26,6 +26,7 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body @@ -271,20 +272,7 @@ class RequestCookieParameters: schema=Schemas.a_b, explode=True, ), - ] - -class RequestBody: - class Schemas: - application_json = schemas.AnyTypeSchema - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) -_all_accept_content_types = ( + ]_all_accept_content_types = ( 'application/json', ) @@ -294,7 +282,7 @@ class BaseApi(api_client.Api): def _parameter_collisions_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -311,7 +299,7 @@ class BaseApi(api_client.Api): def _parameter_collisions_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -330,7 +318,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -344,7 +332,7 @@ class BaseApi(api_client.Api): def _parameter_collisions_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -361,7 +349,7 @@ class BaseApi(api_client.Api): def _parameter_collisions_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -420,7 +408,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -458,7 +446,7 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -475,7 +463,7 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -494,7 +482,7 @@ class ParameterCollisions(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -508,7 +496,7 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -525,7 +513,7 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -556,7 +544,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -573,7 +561,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -592,7 +580,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -606,7 +594,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -623,7 +611,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, query_params: RequestQueryParameters.Params = frozendict.frozendict(), header_params: RequestHeaderParameters.Params = frozendict.frozendict(), path_params: RequestPathParameters.Params = frozendict.frozendict(), diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/request_body.py new file mode 100644 index 00000000000..09ef1d834c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/request_body.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +application_json = schemas.AnyTypeSchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py index b0731015f8d..ebae66731f7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py @@ -27,6 +27,7 @@ from .. import path from . import response_for_200 +from . import request_body @@ -61,83 +62,6 @@ class Params(RequiredParams, OptionalParams): required=True, ), ] - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "requiredFile", - } - - class properties: - additionalMetadata = schemas.StrSchema - requiredFile = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile, - } - - requiredFile: MetaOapg.properties.requiredFile - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - requiredFile: typing.Union[MetaOapg.properties.requiredFile, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - requiredFile=requiredFile, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) - _auth = [ 'petstore_auth', ] @@ -155,7 +79,7 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -169,7 +93,7 @@ def _upload_file_with_required_file_oapg( def _upload_file_with_required_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -185,7 +109,7 @@ def _upload_file_with_required_file_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -196,7 +120,7 @@ def _upload_file_with_required_file_oapg( def _upload_file_with_required_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -210,7 +134,7 @@ def _upload_file_with_required_file_oapg( def _upload_file_with_required_file_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -246,7 +170,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -285,7 +209,7 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -299,7 +223,7 @@ def upload_file_with_required_file( def upload_file_with_required_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -315,7 +239,7 @@ def upload_file_with_required_file( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -326,7 +250,7 @@ def upload_file_with_required_file( def upload_file_with_required_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -340,7 +264,7 @@ def upload_file_with_required_file( def upload_file_with_required_file( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -365,7 +289,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -379,7 +303,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -395,7 +319,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -406,7 +330,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -420,7 +344,7 @@ def post( def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi index 663e77bf699..6a3d9999ba1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi @@ -26,6 +26,7 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body @@ -59,84 +60,7 @@ class RequestPathParameters: schema=Schemas.petId, required=True, ), - ] - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "requiredFile", - } - - class properties: - additionalMetadata = schemas.StrSchema - requiredFile = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile, - } - - requiredFile: MetaOapg.properties.requiredFile - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - requiredFile: typing.Union[MetaOapg.properties.requiredFile, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - requiredFile=requiredFile, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) -_all_accept_content_types = ( + ]_all_accept_content_types = ( 'application/json', ) @@ -146,7 +70,7 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -160,7 +84,7 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -176,7 +100,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -187,7 +111,7 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -201,7 +125,7 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -237,7 +161,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -276,7 +200,7 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -290,7 +214,7 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -306,7 +230,7 @@ class UploadFileWithRequiredFile(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -317,7 +241,7 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -331,7 +255,7 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -356,7 +280,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -370,7 +294,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -386,7 +310,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -397,7 +321,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -411,7 +335,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body.py new file mode 100644 index 00000000000..aaa9e45009b --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class multipart_form_data( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "requiredFile", + } + + class properties: + additionalMetadata = schemas.StrSchema + requiredFile = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, + } + + requiredFile: MetaOapg.properties.requiredFile + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "requiredFile", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + requiredFile: typing.Union[MetaOapg.properties.requiredFile, bytes, io.FileIO, io.BufferedReader, ], + additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'multipart_form_data': + return super().__new__( + cls, + *args, + requiredFile=requiredFile, + additionalMetadata=additionalMetadata, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=multipart_form_data + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py index 665a3e2a97c..6b15a372dc5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ArrayOfEnums - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _array_of_enums_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _array_of_enums_oapg( def _array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _array_of_enums_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _array_of_enums_oapg( def _array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _array_of_enums_oapg( def _array_of_enums_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -131,7 +119,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -169,7 +157,7 @@ class ArrayOfEnums(BaseApi): def array_of_enums( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -182,7 +170,7 @@ def array_of_enums( def array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,7 +185,7 @@ def array_of_enums( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -207,7 +195,7 @@ def array_of_enums( def array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -220,7 +208,7 @@ def array_of_enums( def array_of_enums( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -243,7 +231,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -256,7 +244,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -271,7 +259,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -281,7 +269,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -294,7 +282,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi index 5150a504a48..90929867073 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.array_of_enums import ArrayOfEnums from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = ArrayOfEnums - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _array_of_enums_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _array_of_enums_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _array_of_enums_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -126,7 +114,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -164,7 +152,7 @@ class ArrayOfEnums(BaseApi): def array_of_enums( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -177,7 +165,7 @@ class ArrayOfEnums(BaseApi): def array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,7 +180,7 @@ class ArrayOfEnums(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -202,7 +190,7 @@ class ArrayOfEnums(BaseApi): def array_of_enums( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -215,7 +203,7 @@ class ArrayOfEnums(BaseApi): def array_of_enums( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -238,7 +226,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -251,7 +239,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -266,7 +254,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -276,7 +264,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -289,7 +277,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body.py new file mode 100644 index 00000000000..9dfb2191ae0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.array_of_enums import ArrayOfEnums + + +application_json = ArrayOfEnums + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py index ed9e2d4e32c..97ac4f5d5e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = AnimalFarm - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _array_model_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _array_model_oapg( def _array_model_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _array_model_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _array_model_oapg( def _array_model_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _array_model_oapg( def _array_model_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class ArrayModel(BaseApi): def array_model( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def array_model( def array_model( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def array_model( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def array_model( def array_model( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def array_model( def array_model( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi index 33c48ad9941..708c0befb3e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.animal_farm import AnimalFarm from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = AnimalFarm - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _array_model_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _array_model_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _array_model_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _array_model_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class ArrayModel(BaseApi): def array_model( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class ArrayModel(BaseApi): def array_model( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class ArrayModel(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class ArrayModel(BaseApi): def array_model( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class ArrayModel(BaseApi): def array_model( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body.py new file mode 100644 index 00000000000..7544c6e4fd5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.animal_farm import AnimalFarm + + +application_json = AnimalFarm + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py index 401be086bad..d54d0e6fcc8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Boolean - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _boolean_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _boolean_oapg( def _boolean_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _boolean_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _boolean_oapg( def _boolean_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _boolean_oapg( def _boolean_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class Boolean(BaseApi): def boolean( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def boolean( def boolean( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def boolean( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def boolean( def boolean( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def boolean( def boolean( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi index 4640be400ba..22dd64fad12 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.boolean import Boolean from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Boolean - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _boolean_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _boolean_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _boolean_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _boolean_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class Boolean(BaseApi): def boolean( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class Boolean(BaseApi): def boolean( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class Boolean(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class Boolean(BaseApi): def boolean( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class Boolean(BaseApi): def boolean( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body.py new file mode 100644 index 00000000000..fdc584d448a --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.boolean import Boolean + + +application_json = Boolean + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py index 17a062431ea..1767bf02a25 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ComposedOneOfDifferentTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _composed_one_of_different_types_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _composed_one_of_different_types_oapg( def _composed_one_of_different_types_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _composed_one_of_different_types_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _composed_one_of_different_types_oapg( def _composed_one_of_different_types_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _composed_one_of_different_types_oapg( def _composed_one_of_different_types_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class ComposedOneOfDifferentTypes(BaseApi): def composed_one_of_different_types( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def composed_one_of_different_types( def composed_one_of_different_types( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def composed_one_of_different_types( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def composed_one_of_different_types( def composed_one_of_different_types( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def composed_one_of_different_types( def composed_one_of_different_types( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi index 389e3f57519..02a2ad57c1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = ComposedOneOfDifferentTypes - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _composed_one_of_different_types_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _composed_one_of_different_types_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _composed_one_of_different_types_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _composed_one_of_different_types_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class ComposedOneOfDifferentTypes(BaseApi): def composed_one_of_different_types( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class ComposedOneOfDifferentTypes(BaseApi): def composed_one_of_different_types( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class ComposedOneOfDifferentTypes(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class ComposedOneOfDifferentTypes(BaseApi): def composed_one_of_different_types( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class ComposedOneOfDifferentTypes(BaseApi): def composed_one_of_different_types( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body.py new file mode 100644 index 00000000000..3420d9e500f --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes + + +application_json = ComposedOneOfDifferentTypes + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py index 8f03d0c8ecd..873c79d8ba7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = StringEnum - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _string_enum_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _string_enum_oapg( def _string_enum_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _string_enum_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _string_enum_oapg( def _string_enum_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _string_enum_oapg( def _string_enum_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class StringEnum(BaseApi): def string_enum( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def string_enum( def string_enum( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def string_enum( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def string_enum( def string_enum( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def string_enum( def string_enum( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi index 76432aeea5e..cd7dbfa8f85 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.string_enum import StringEnum from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = StringEnum - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _string_enum_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _string_enum_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _string_enum_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _string_enum_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class StringEnum(BaseApi): def string_enum( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class StringEnum(BaseApi): def string_enum( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class StringEnum(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class StringEnum(BaseApi): def string_enum( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class StringEnum(BaseApi): def string_enum( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body.py new file mode 100644 index 00000000000..4bd1b23c5aa --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.string_enum import StringEnum + + +application_json = StringEnum + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py index d9e9f6cc462..f860aa7df3c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Mammal - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +44,7 @@ class BaseApi(api_client.Api): @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -70,7 +57,7 @@ def _mammal_oapg( @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -84,7 +71,7 @@ def _mammal_oapg( @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -95,7 +82,7 @@ def _mammal_oapg( @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -108,7 +95,7 @@ def _mammal_oapg( def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -133,7 +120,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -170,7 +157,7 @@ class Mammal(BaseApi): @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -183,7 +170,7 @@ def mammal( @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -197,7 +184,7 @@ def mammal( @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -208,7 +195,7 @@ def mammal( @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -221,7 +208,7 @@ def mammal( def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -244,7 +231,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -257,7 +244,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -271,7 +258,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -282,7 +269,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -295,7 +282,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi index a279e0a65a4..1c2957e4ae1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi @@ -28,21 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.mammal import Mammal from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Mammal - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +39,7 @@ class BaseApi(api_client.Api): @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -65,7 +52,7 @@ class BaseApi(api_client.Api): @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -79,7 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -90,7 +77,7 @@ class BaseApi(api_client.Api): @typing.overload def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -103,7 +90,7 @@ class BaseApi(api_client.Api): def _mammal_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -128,7 +115,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -165,7 +152,7 @@ class Mammal(BaseApi): @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -178,7 +165,7 @@ class Mammal(BaseApi): @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -192,7 +179,7 @@ class Mammal(BaseApi): @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -203,7 +190,7 @@ class Mammal(BaseApi): @typing.overload def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -216,7 +203,7 @@ class Mammal(BaseApi): def mammal( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -239,7 +226,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -252,7 +239,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -266,7 +253,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -277,7 +264,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -290,7 +277,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body.py new file mode 100644 index 00000000000..ef876f7d679 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.mammal import Mammal + + +application_json = Mammal + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py index 02915fddf42..2261b7c202f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = NumberWithValidations - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _number_with_validations_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _number_with_validations_oapg( def _number_with_validations_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _number_with_validations_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _number_with_validations_oapg( def _number_with_validations_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _number_with_validations_oapg( def _number_with_validations_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class NumberWithValidations(BaseApi): def number_with_validations( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def number_with_validations( def number_with_validations( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def number_with_validations( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def number_with_validations( def number_with_validations( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def number_with_validations( def number_with_validations( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi index ab5aae6b249..6635642d469 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.number_with_validations import NumberWithValidations from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = NumberWithValidations - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _number_with_validations_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _number_with_validations_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _number_with_validations_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _number_with_validations_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class NumberWithValidations(BaseApi): def number_with_validations( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class NumberWithValidations(BaseApi): def number_with_validations( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class NumberWithValidations(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class NumberWithValidations(BaseApi): def number_with_validations( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class NumberWithValidations(BaseApi): def number_with_validations( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body.py new file mode 100644 index 00000000000..c77aa8589c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.number_with_validations import NumberWithValidations + + +application_json = NumberWithValidations + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py index 777bdc99da7..c929d62a644 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = ObjectModelWithRefProps - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _object_model_with_ref_props_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _object_model_with_ref_props_oapg( def _object_model_with_ref_props_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _object_model_with_ref_props_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _object_model_with_ref_props_oapg( def _object_model_with_ref_props_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _object_model_with_ref_props_oapg( def _object_model_with_ref_props_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class ObjectModelWithRefProps(BaseApi): def object_model_with_ref_props( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def object_model_with_ref_props( def object_model_with_ref_props( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def object_model_with_ref_props( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def object_model_with_ref_props( def object_model_with_ref_props( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def object_model_with_ref_props( def object_model_with_ref_props( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi index e3e487efa89..2321ea98623 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = ObjectModelWithRefProps - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _object_model_with_ref_props_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _object_model_with_ref_props_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _object_model_with_ref_props_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _object_model_with_ref_props_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class ObjectModelWithRefProps(BaseApi): def object_model_with_ref_props( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class ObjectModelWithRefProps(BaseApi): def object_model_with_ref_props( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class ObjectModelWithRefProps(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class ObjectModelWithRefProps(BaseApi): def object_model_with_ref_props( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class ObjectModelWithRefProps(BaseApi): def object_model_with_ref_props( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body.py new file mode 100644 index 00000000000..20ac57230a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + + +application_json = ObjectModelWithRefProps + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py index faacfc29015..d8ce8819827 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py @@ -29,21 +29,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_json = String - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -57,7 +45,7 @@ class BaseApi(api_client.Api): def _string_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -70,7 +58,7 @@ def _string_oapg( def _string_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -85,7 +73,7 @@ def _string_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -95,7 +83,7 @@ def _string_oapg( def _string_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -108,7 +96,7 @@ def _string_oapg( def _string_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -130,7 +118,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +156,7 @@ class String(BaseApi): def string( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -181,7 +169,7 @@ def string( def string( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +184,7 @@ def string( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +194,7 @@ def string( def string( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,7 +207,7 @@ def string( def string( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -242,7 +230,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -255,7 +243,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -270,7 +258,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -280,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -293,7 +281,7 @@ def post( def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi index 5e269b88243..c6a96d5d45d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi @@ -28,20 +28,8 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.string import String from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = String - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -52,7 +40,7 @@ class BaseApi(api_client.Api): def _string_oapg( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -65,7 +53,7 @@ class BaseApi(api_client.Api): def _string_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -80,7 +68,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -90,7 +78,7 @@ class BaseApi(api_client.Api): def _string_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -103,7 +91,7 @@ class BaseApi(api_client.Api): def _string_oapg( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -125,7 +113,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -163,7 +151,7 @@ class String(BaseApi): def string( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +164,7 @@ class String(BaseApi): def string( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +179,7 @@ class String(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +189,7 @@ class String(BaseApi): def string( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +202,7 @@ class String(BaseApi): def string( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -237,7 +225,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/json"] = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -250,7 +238,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -265,7 +253,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +263,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -288,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/json', - body: typing.Union[RequestBody.Schemas.application_json, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_json, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body.py new file mode 100644 index 00000000000..1fb461ce202 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.string import String + + +application_json = String + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py index c9ccdb31147..50216505726 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py @@ -27,22 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - application_octet_stream = schemas.BinarySchema - - parameter = api_client.RequestBody( - content={ - 'application/octet-stream': api_client.MediaType( - schema=Schemas.application_octet_stream - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -55,7 +42,7 @@ class BaseApi(api_client.Api): @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -68,7 +55,7 @@ def _upload_download_file_oapg( @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -82,7 +69,7 @@ def _upload_download_file_oapg( @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -93,7 +80,7 @@ def _upload_download_file_oapg( @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -106,7 +93,7 @@ def _upload_download_file_oapg( def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -132,7 +119,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -169,7 +156,7 @@ class UploadDownloadFile(BaseApi): @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -182,7 +169,7 @@ def upload_download_file( @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -196,7 +183,7 @@ def upload_download_file( @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -207,7 +194,7 @@ def upload_download_file( @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -220,7 +207,7 @@ def upload_download_file( def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -243,7 +230,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -256,7 +243,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -270,7 +257,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -281,7 +268,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -294,7 +281,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi index eab65e6c7c9..821c15c7775 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi @@ -26,21 +26,8 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - application_octet_stream = schemas.BinarySchema - - parameter = api_client.RequestBody( - content={ - 'application/octet-stream': api_client.MediaType( - schema=Schemas.application_octet_stream - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/octet-stream', ) @@ -50,7 +37,7 @@ class BaseApi(api_client.Api): @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -63,7 +50,7 @@ class BaseApi(api_client.Api): @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -77,7 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -88,7 +75,7 @@ class BaseApi(api_client.Api): @typing.overload def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -101,7 +88,7 @@ class BaseApi(api_client.Api): def _upload_download_file_oapg( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -127,7 +114,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -164,7 +151,7 @@ class UploadDownloadFile(BaseApi): @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -177,7 +164,7 @@ class UploadDownloadFile(BaseApi): @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -191,7 +178,7 @@ class UploadDownloadFile(BaseApi): @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -202,7 +189,7 @@ class UploadDownloadFile(BaseApi): @typing.overload def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -215,7 +202,7 @@ class UploadDownloadFile(BaseApi): def upload_download_file( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -238,7 +225,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: typing_extensions.Literal["application/octet-stream"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -251,7 +238,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -265,7 +252,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -276,7 +263,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -289,7 +276,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], + body: typing.Union[request_body.application_octet_stream,bytes, io.FileIO, io.BufferedReader, ], content_type: str = 'application/octet-stream', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body.py new file mode 100644 index 00000000000..7357826be7d --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +application_octet_stream = schemas.BinarySchema + +parameter_oapg = api_client.RequestBody( + content={ + 'application/octet-stream': api_client.MediaType( + schema=application_octet_stream + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py index 0b40b9a1edb..78a89109703 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py @@ -27,85 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "file", - } - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - file: MetaOapg.properties.file - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - file=file, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -119,7 +43,7 @@ class BaseApi(api_client.Api): def _upload_file_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -132,7 +56,7 @@ def _upload_file_oapg( def _upload_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -147,7 +71,7 @@ def _upload_file_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -157,7 +81,7 @@ def _upload_file_oapg( def _upload_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -170,7 +94,7 @@ def _upload_file_oapg( def _upload_file_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -193,7 +117,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -231,7 +155,7 @@ class UploadFile(BaseApi): def upload_file( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -244,7 +168,7 @@ def upload_file( def upload_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -259,7 +183,7 @@ def upload_file( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +193,7 @@ def upload_file( def upload_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -282,7 +206,7 @@ def upload_file( def upload_file( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -305,7 +229,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -318,7 +242,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -333,7 +257,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -343,7 +267,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -356,7 +280,7 @@ def post( def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi index b96a31b06dd..84512612a50 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi @@ -26,84 +26,8 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - required = { - "file", - } - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - file: MetaOapg.properties.file - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - file=file, - additionalMetadata=additionalMetadata, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -114,7 +38,7 @@ class BaseApi(api_client.Api): def _upload_file_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -127,7 +51,7 @@ class BaseApi(api_client.Api): def _upload_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -142,7 +66,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -152,7 +76,7 @@ class BaseApi(api_client.Api): def _upload_file_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -165,7 +89,7 @@ class BaseApi(api_client.Api): def _upload_file_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -188,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -226,7 +150,7 @@ class UploadFile(BaseApi): def upload_file( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +163,7 @@ class UploadFile(BaseApi): def upload_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -254,7 +178,7 @@ class UploadFile(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -264,7 +188,7 @@ class UploadFile(BaseApi): def upload_file( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -277,7 +201,7 @@ class UploadFile(BaseApi): def upload_file( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -300,7 +224,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -313,7 +237,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -328,7 +252,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -338,7 +262,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -351,7 +275,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body.py new file mode 100644 index 00000000000..5370576a668 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class multipart_form_data( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "file", + } + + class properties: + additionalMetadata = schemas.StrSchema + file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } + + file: MetaOapg.properties.file + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, ], + additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'multipart_form_data': + return super().__new__( + cls, + *args, + file=file, + additionalMetadata=additionalMetadata, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=multipart_form_data + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py index c44aa625c78..18952344aaf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py @@ -27,92 +27,9 @@ from .. import path from . import response_for_200 +from . import request_body - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.BinarySchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - files=files, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) - _status_code_to_response = { '200': response_for_200.response, } @@ -126,7 +43,7 @@ class BaseApi(api_client.Api): def _upload_files_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +56,7 @@ def _upload_files_oapg( def _upload_files_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -154,7 +71,7 @@ def _upload_files_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -164,7 +81,7 @@ def _upload_files_oapg( def _upload_files_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -177,7 +94,7 @@ def _upload_files_oapg( def _upload_files_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -200,7 +117,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -238,7 +155,7 @@ class UploadFiles(BaseApi): def upload_files( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -251,7 +168,7 @@ def upload_files( def upload_files( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -266,7 +183,7 @@ def upload_files( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -276,7 +193,7 @@ def upload_files( def upload_files( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -289,7 +206,7 @@ def upload_files( def upload_files( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -312,7 +229,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -325,7 +242,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -340,7 +257,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -350,7 +267,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -363,7 +280,7 @@ def post( def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi index 2f0fc18a23b..6ea2da353d5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi @@ -26,91 +26,8 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body - - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.BinarySchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - files=files, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) _all_accept_content_types = ( 'application/json', ) @@ -121,7 +38,7 @@ class BaseApi(api_client.Api): def _upload_files_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -134,7 +51,7 @@ class BaseApi(api_client.Api): def _upload_files_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -149,7 +66,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -159,7 +76,7 @@ class BaseApi(api_client.Api): def _upload_files_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -172,7 +89,7 @@ class BaseApi(api_client.Api): def _upload_files_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -233,7 +150,7 @@ class UploadFiles(BaseApi): def upload_files( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -246,7 +163,7 @@ class UploadFiles(BaseApi): def upload_files( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -261,7 +178,7 @@ class UploadFiles(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -271,7 +188,7 @@ class UploadFiles(BaseApi): def upload_files( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -284,7 +201,7 @@ class UploadFiles(BaseApi): def upload_files( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -307,7 +224,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -320,7 +237,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -335,7 +252,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -345,7 +262,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -358,7 +275,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body.py new file mode 100644 index 00000000000..17867103306 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class multipart_form_data( + schemas.DictSchema +): + + + class MetaOapg: + + class properties: + + + class files( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.BinarySchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, bytes, io.FileIO, io.BufferedReader, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'files': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "files": files, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["files", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["files", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'multipart_form_data': + return super().__new__( + cls, + *args, + files=files, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=multipart_form_data + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py index d1ac56e3a4d..d6cf0a3d254 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py @@ -30,26 +30,9 @@ from .. import path from . import response_for_200 from . import response_for_405 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Pet - application_xml = Pet - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'application/xml': api_client.MediaType( - schema=Schemas.application_xml - ), - }, - required=True, - ) - _auth = [ 'http_signature_test', 'petstore_auth', @@ -76,7 +59,7 @@ class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -89,7 +72,7 @@ def _add_pet_oapg( @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -102,7 +85,7 @@ def _add_pet_oapg( @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -116,7 +99,7 @@ def _add_pet_oapg( @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -127,7 +110,7 @@ def _add_pet_oapg( @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -140,7 +123,7 @@ def _add_pet_oapg( def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -163,7 +146,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -204,7 +187,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -217,7 +200,7 @@ def add_pet( @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -230,7 +213,7 @@ def add_pet( @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -244,7 +227,7 @@ def add_pet( @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -255,7 +238,7 @@ def add_pet( @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -268,7 +251,7 @@ def add_pet( def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -291,7 +274,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -304,7 +287,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -317,7 +300,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -331,7 +314,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -342,7 +325,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -355,7 +338,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi index 8d855b69484..b740b83f419 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi @@ -29,32 +29,15 @@ from petstore_api.model.pet import Pet from . import response_for_200 from . import response_for_405 +from . import request_body -class RequestBody: - class Schemas: - application_json = Pet - application_xml = Pet - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'application/xml': api_client.MediaType( - schema=Schemas.application_xml - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -67,7 +50,7 @@ class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -80,7 +63,7 @@ class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -94,7 +77,7 @@ class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -105,7 +88,7 @@ class BaseApi(api_client.Api): @typing.overload def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -118,7 +101,7 @@ class BaseApi(api_client.Api): def _add_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -141,7 +124,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -182,7 +165,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -195,7 +178,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -208,7 +191,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -222,7 +205,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -233,7 +216,7 @@ class AddPet(BaseApi): @typing.overload def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -246,7 +229,7 @@ class AddPet(BaseApi): def add_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -269,7 +252,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -282,7 +265,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -295,7 +278,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -309,7 +292,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -320,7 +303,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -333,7 +316,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/request_body.py new file mode 100644 index 00000000000..ae6aff45f28 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/request_body.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + + +application_json = Pet +application_xml = Pet + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + 'application/xml': api_client.MediaType( + schema=application_xml + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py index d1bd29e254b..480f66ac869 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py @@ -31,26 +31,9 @@ from . import response_for_400 from . import response_for_404 from . import response_for_405 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Pet - application_xml = Pet - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'application/xml': api_client.MediaType( - schema=Schemas.application_xml - ), - }, - required=True, - ) - _auth = [ 'http_signature_test', 'petstore_auth', @@ -78,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -88,7 +71,7 @@ def _update_pet_oapg( @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -98,7 +81,7 @@ def _update_pet_oapg( @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -109,7 +92,7 @@ def _update_pet_oapg( @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -120,7 +103,7 @@ def _update_pet_oapg( @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -132,7 +115,7 @@ def _update_pet_oapg( def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -155,7 +138,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -196,7 +179,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -206,7 +189,7 @@ def update_pet( @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -216,7 +199,7 @@ def update_pet( @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -227,7 +210,7 @@ def update_pet( @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -238,7 +221,7 @@ def update_pet( @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -250,7 +233,7 @@ def update_pet( def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -273,7 +256,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -283,7 +266,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -293,7 +276,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -304,7 +287,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -315,7 +298,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -327,7 +310,7 @@ def put( def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi index 9ec97b5077c..b1c8a7c7065 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi @@ -30,32 +30,15 @@ from petstore_api.model.pet import Pet from . import response_for_400 from . import response_for_404 from . import response_for_405 +from . import request_body -class RequestBody: - class Schemas: - application_json = Pet - application_xml = Pet - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - 'application/xml': api_client.MediaType( - schema=Schemas.application_xml - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -65,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -75,7 +58,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -86,7 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -97,7 +80,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -109,7 +92,7 @@ class BaseApi(api_client.Api): def _update_pet_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -132,7 +115,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -173,7 +156,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -183,7 +166,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -193,7 +176,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -204,7 +187,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -215,7 +198,7 @@ class UpdatePet(BaseApi): @typing.overload def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -227,7 +210,7 @@ class UpdatePet(BaseApi): def update_pet( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, @@ -250,7 +233,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -260,7 +243,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_xml,], content_type: typing_extensions.Literal["application/xml"], host_index: typing.Optional[int] = None, stream: bool = False, @@ -270,7 +253,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -281,7 +264,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., host_index: typing.Optional[int] = None, @@ -292,7 +275,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = ..., host_index: typing.Optional[int] = None, stream: bool = False, @@ -304,7 +287,7 @@ class ApiForput(BaseApi): def put( self, - body: typing.Union[RequestBody.Schemas.application_json,RequestBody.Schemas.application_xml,], + body: typing.Union[request_body.application_json,request_body.application_xml,], content_type: str = 'application/json', host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/request_body.py new file mode 100644 index 00000000000..ae6aff45f28 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/request_body.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + + +application_json = Pet +application_xml = Pet + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + 'application/xml': api_client.MediaType( + schema=application_xml + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py index d71f45b596c..0eebae72657 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py @@ -27,6 +27,7 @@ from .. import path from . import response_for_405 +from . import request_body @@ -61,78 +62,6 @@ class Params(RequiredParams, OptionalParams): required=True, ), ] - -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - status = schemas.StrSchema - __annotations__ = { - "name": name, - "status": status, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - name=name, - status=status, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - _auth = [ 'petstore_auth', ] @@ -147,7 +76,7 @@ class BaseApi(api_client.Api): def _update_pet_with_form_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -157,7 +86,7 @@ def _update_pet_with_form_oapg( def _update_pet_with_form_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -169,7 +98,7 @@ def _update_pet_with_form_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +108,7 @@ def _update_pet_with_form_oapg( def _update_pet_with_form_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,7 +120,7 @@ def _update_pet_with_form_oapg( def _update_pet_with_form_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -223,7 +152,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -262,7 +191,7 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -272,7 +201,7 @@ def update_pet_with_form( def update_pet_with_form( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -284,7 +213,7 @@ def update_pet_with_form( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -294,7 +223,7 @@ def update_pet_with_form( def update_pet_with_form( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -306,7 +235,7 @@ def update_pet_with_form( def update_pet_with_form( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -329,7 +258,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -339,7 +268,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -351,7 +280,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -361,7 +290,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -373,7 +302,7 @@ def post( def post( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi index a411ed2af72..04fb9d5faf5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi @@ -26,6 +26,7 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_405 +from . import request_body @@ -61,84 +62,12 @@ class RequestPathParameters: ), ] -class RequestBody: - class Schemas: - - - class application_x_www_form_urlencoded( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - status = schemas.StrSchema - __annotations__ = { - "name": name, - "status": status, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'application_x_www_form_urlencoded': - return super().__new__( - cls, - *args, - name=name, - status=status, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'application/x-www-form-urlencoded': api_client.MediaType( - schema=Schemas.application_x_www_form_urlencoded - ), - }, - ) - - class BaseApi(api_client.Api): @typing.overload def _update_pet_with_form_oapg( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,7 +77,7 @@ class BaseApi(api_client.Api): def _update_pet_with_form_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -160,7 +89,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -170,7 +99,7 @@ class BaseApi(api_client.Api): def _update_pet_with_form_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -182,7 +111,7 @@ class BaseApi(api_client.Api): def _update_pet_with_form_oapg( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +143,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -253,7 +182,7 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -263,7 +192,7 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -275,7 +204,7 @@ class UpdatePetWithForm(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -285,7 +214,7 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -297,7 +226,7 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -320,7 +249,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -330,7 +259,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -342,7 +271,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -352,7 +281,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -364,7 +293,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'application/x-www-form-urlencoded', - body: typing.Union[RequestBody.Schemas.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.application_x_www_form_urlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body.py new file mode 100644 index 00000000000..08819524a85 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class application_x_www_form_urlencoded( + schemas.DictSchema +): + + + class MetaOapg: + + class properties: + name = schemas.StrSchema + status = schemas.StrSchema + __annotations__ = { + "name": name, + "status": status, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "status", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'application_x_www_form_urlencoded': + return super().__new__( + cls, + *args, + name=name, + status=status, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=application_x_www_form_urlencoded + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py index 6769678ad3c..c63e30e2c01 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py @@ -27,6 +27,7 @@ from .. import path from . import response_for_200 +from . import request_body @@ -61,78 +62,6 @@ class Params(RequiredParams, OptionalParams): required=True, ), ] - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union[MetaOapg.properties.file, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - additionalMetadata=additionalMetadata, - file=file, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) - _auth = [ 'petstore_auth', ] @@ -150,7 +79,7 @@ class BaseApi(api_client.Api): def _upload_image_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -164,7 +93,7 @@ def _upload_image_oapg( def _upload_image_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -180,7 +109,7 @@ def _upload_image_oapg( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -191,7 +120,7 @@ def _upload_image_oapg( def _upload_image_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -205,7 +134,7 @@ def _upload_image_oapg( def _upload_image_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -241,7 +170,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -280,7 +209,7 @@ class UploadImage(BaseApi): def upload_image( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -294,7 +223,7 @@ def upload_image( def upload_image( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -310,7 +239,7 @@ def upload_image( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -321,7 +250,7 @@ def upload_image( def upload_image( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -335,7 +264,7 @@ def upload_image( def upload_image( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -360,7 +289,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -374,7 +303,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -390,7 +319,7 @@ def post( self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -401,7 +330,7 @@ def post( def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -415,7 +344,7 @@ def post( def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi index d9b6f1e5bfd..eff1bf1d746 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi @@ -26,6 +26,7 @@ import frozendict # noqa: F401 from petstore_api import schemas # noqa: F401 from . import response_for_200 +from . import request_body @@ -59,79 +60,7 @@ class RequestPathParameters: schema=Schemas.petId, required=True, ), - ] - -class RequestBody: - class Schemas: - - - class multipart_form_data( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - additionalMetadata = schemas.StrSchema - file = schemas.BinarySchema - __annotations__ = { - "additionalMetadata": additionalMetadata, - "file": file, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union[MetaOapg.properties.file, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, - file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'multipart_form_data': - return super().__new__( - cls, - *args, - additionalMetadata=additionalMetadata, - file=file, - _configuration=_configuration, - **kwargs, - ) - - parameter = api_client.RequestBody( - content={ - 'multipart/form-data': api_client.MediaType( - schema=Schemas.multipart_form_data - ), - }, - ) -_all_accept_content_types = ( + ]_all_accept_content_types = ( 'application/json', ) @@ -141,7 +70,7 @@ class BaseApi(api_client.Api): def _upload_image_oapg( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -155,7 +84,7 @@ class BaseApi(api_client.Api): def _upload_image_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -171,7 +100,7 @@ class BaseApi(api_client.Api): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -182,7 +111,7 @@ class BaseApi(api_client.Api): def _upload_image_oapg( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -196,7 +125,7 @@ class BaseApi(api_client.Api): def _upload_image_oapg( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -232,7 +161,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -271,7 +200,7 @@ class UploadImage(BaseApi): def upload_image( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -285,7 +214,7 @@ class UploadImage(BaseApi): def upload_image( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -301,7 +230,7 @@ class UploadImage(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -312,7 +241,7 @@ class UploadImage(BaseApi): def upload_image( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -326,7 +255,7 @@ class UploadImage(BaseApi): def upload_image( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -351,7 +280,7 @@ class ApiForpost(BaseApi): def post( self, content_type: typing_extensions.Literal["multipart/form-data"] = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -365,7 +294,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -381,7 +310,7 @@ class ApiForpost(BaseApi): self, skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -392,7 +321,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = ..., - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -406,7 +335,7 @@ class ApiForpost(BaseApi): def post( self, content_type: str = 'multipart/form-data', - body: typing.Union[RequestBody.Schemas.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[request_body.multipart_form_data, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, path_params: RequestPathParameters.Params = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body.py new file mode 100644 index 00000000000..b8e76d9ff3a --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + + +class multipart_form_data( + schemas.DictSchema +): + + + class MetaOapg: + + class properties: + additionalMetadata = schemas.StrSchema + file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> MetaOapg.properties.file: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["additionalMetadata"]) -> typing.Union[MetaOapg.properties.additionalMetadata, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union[MetaOapg.properties.file, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["additionalMetadata", "file", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, + file: typing.Union[MetaOapg.properties.file, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'multipart_form_data': + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + file=file, + _configuration=_configuration, + **kwargs, + ) + +parameter_oapg = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=multipart_form_data + ), + }, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py index e6dc9ea12cf..6062a3b674a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py @@ -30,22 +30,9 @@ from .. import path from . import response_for_200 from . import response_for_400 +from . import request_body - -class RequestBody: - class Schemas: - application_json = Order - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '200': response_for_200.response, '400': response_for_400.response, @@ -60,7 +47,7 @@ class BaseApi(api_client.Api): @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -73,7 +60,7 @@ def _place_order_oapg( @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -87,7 +74,7 @@ def _place_order_oapg( @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -98,7 +85,7 @@ def _place_order_oapg( @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -111,7 +98,7 @@ def _place_order_oapg( def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -137,7 +124,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -174,7 +161,7 @@ class PlaceOrder(BaseApi): @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -187,7 +174,7 @@ def place_order( @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -201,7 +188,7 @@ def place_order( @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -212,7 +199,7 @@ def place_order( @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -225,7 +212,7 @@ def place_order( def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -248,7 +235,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -261,7 +248,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -275,7 +262,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -286,7 +273,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -299,7 +286,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi index 86a048365ca..d746aa5a746 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi @@ -29,21 +29,8 @@ from petstore_api.model.order import Order from . import response_for_200 from . import response_for_400 +from . import request_body - - -class RequestBody: - class Schemas: - application_json = Order - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -67,7 +54,7 @@ class BaseApi(api_client.Api): @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -81,7 +68,7 @@ class BaseApi(api_client.Api): @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -92,7 +79,7 @@ class BaseApi(api_client.Api): @typing.overload def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -105,7 +92,7 @@ class BaseApi(api_client.Api): def _place_order_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -131,7 +118,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -168,7 +155,7 @@ class PlaceOrder(BaseApi): @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -181,7 +168,7 @@ class PlaceOrder(BaseApi): @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -195,7 +182,7 @@ class PlaceOrder(BaseApi): @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -206,7 +193,7 @@ class PlaceOrder(BaseApi): @typing.overload def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -219,7 +206,7 @@ class PlaceOrder(BaseApi): def place_order( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -242,7 +229,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -255,7 +242,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -269,7 +256,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -280,7 +267,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -293,7 +280,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body.py new file mode 100644 index 00000000000..71d898f7332 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.order import Order + + +application_json = Order + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py index dc607656849..1714a409b53 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py @@ -29,22 +29,9 @@ from .. import path from . import response_for_default +from . import request_body - -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { 'default': response_for_default.response, } @@ -54,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -66,7 +53,7 @@ def _create_user_oapg( @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -79,7 +66,7 @@ def _create_user_oapg( @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -89,7 +76,7 @@ def _create_user_oapg( @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -101,7 +88,7 @@ def _create_user_oapg( def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -123,7 +110,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -164,7 +151,7 @@ class CreateUser(BaseApi): @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,7 +163,7 @@ def create_user( @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -189,7 +176,7 @@ def create_user( @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -199,7 +186,7 @@ def create_user( @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -211,7 +198,7 @@ def create_user( def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -232,7 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -244,7 +231,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -257,7 +244,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -267,7 +254,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -279,7 +266,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi index 0d0e9a2697f..605301b75b8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi @@ -28,28 +28,15 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User from . import response_for_default +from . import request_body -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -61,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -74,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -84,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -96,7 +83,7 @@ class BaseApi(api_client.Api): def _create_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -118,7 +105,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -159,7 +146,7 @@ class CreateUser(BaseApi): @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,7 +158,7 @@ class CreateUser(BaseApi): @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,7 +171,7 @@ class CreateUser(BaseApi): @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -194,7 +181,7 @@ class CreateUser(BaseApi): @typing.overload def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +193,7 @@ class CreateUser(BaseApi): def create_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -227,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,7 +226,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +239,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -262,7 +249,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -274,7 +261,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body.py new file mode 100644 index 00000000000..44bdfbbd588 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + + +application_json = User + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py index 7d4708019ed..237c4aea51d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py @@ -29,47 +29,9 @@ from .. import path from . import response_for_default +from . import request_body - -class RequestBody: - class Schemas: - - - class application_json( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'application_json': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { 'default': response_for_default.response, } @@ -79,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -91,7 +53,7 @@ def _create_users_with_array_input_oapg( @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -104,7 +66,7 @@ def _create_users_with_array_input_oapg( @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -114,7 +76,7 @@ def _create_users_with_array_input_oapg( @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -126,7 +88,7 @@ def _create_users_with_array_input_oapg( def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,7 +110,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -189,7 +151,7 @@ class CreateUsersWithArrayInput(BaseApi): @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +163,7 @@ def create_users_with_array_input( @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +176,7 @@ def create_users_with_array_input( @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -224,7 +186,7 @@ def create_users_with_array_input( @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -236,7 +198,7 @@ def create_users_with_array_input( def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -257,7 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +231,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -282,7 +244,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -292,7 +254,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -304,7 +266,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi index dc46a6936c7..7fe43bf905e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi @@ -28,53 +28,15 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User from . import response_for_default +from . import request_body -class RequestBody: - class Schemas: - - - class application_json( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'application_json': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -86,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -99,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -109,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -121,7 +83,7 @@ class BaseApi(api_client.Api): def _create_users_with_array_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,7 +105,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -184,7 +146,7 @@ class CreateUsersWithArrayInput(BaseApi): @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +158,7 @@ class CreateUsersWithArrayInput(BaseApi): @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -209,7 +171,7 @@ class CreateUsersWithArrayInput(BaseApi): @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -219,7 +181,7 @@ class CreateUsersWithArrayInput(BaseApi): @typing.overload def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -231,7 +193,7 @@ class CreateUsersWithArrayInput(BaseApi): def create_users_with_array_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -264,7 +226,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -277,7 +239,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -287,7 +249,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -299,7 +261,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/request_body.py new file mode 100644 index 00000000000..c038ca7e1e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/request_body.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + + + + +class application_json( + schemas.ListSchema +): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['User']: + return User + + def __new__( + cls, + arg: typing.Union[typing.Tuple['User'], typing.List['User']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'application_json': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'User': + return super().__getitem__(i) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py index 36bb233af20..eb7c0d373e8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py @@ -29,47 +29,9 @@ from .. import path from . import response_for_default +from . import request_body - -class RequestBody: - class Schemas: - - - class application_json( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'application_json': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { 'default': response_for_default.response, } @@ -79,7 +41,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -91,7 +53,7 @@ def _create_users_with_list_input_oapg( @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -104,7 +66,7 @@ def _create_users_with_list_input_oapg( @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -114,7 +76,7 @@ def _create_users_with_list_input_oapg( @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -126,7 +88,7 @@ def _create_users_with_list_input_oapg( def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,7 +110,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -189,7 +151,7 @@ class CreateUsersWithListInput(BaseApi): @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -201,7 +163,7 @@ def create_users_with_list_input( @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,7 +176,7 @@ def create_users_with_list_input( @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -224,7 +186,7 @@ def create_users_with_list_input( @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -236,7 +198,7 @@ def create_users_with_list_input( def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -257,7 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -269,7 +231,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -282,7 +244,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -292,7 +254,7 @@ def post( @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -304,7 +266,7 @@ def post( def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi index a6850fde31a..ac124ef6712 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi @@ -28,53 +28,15 @@ from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User from . import response_for_default +from . import request_body -class RequestBody: - class Schemas: - - - class application_json( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['User']: - return User - - def __new__( - cls, - arg: typing.Union[typing.Tuple['User'], typing.List['User']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'application_json': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'User': - return super().__getitem__(i) - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -86,7 +48,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -99,7 +61,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -109,7 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -121,7 +83,7 @@ class BaseApi(api_client.Api): def _create_users_with_list_input_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,7 +105,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -184,7 +146,7 @@ class CreateUsersWithListInput(BaseApi): @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,7 +158,7 @@ class CreateUsersWithListInput(BaseApi): @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -209,7 +171,7 @@ class CreateUsersWithListInput(BaseApi): @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -219,7 +181,7 @@ class CreateUsersWithListInput(BaseApi): @typing.overload def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -231,7 +193,7 @@ class CreateUsersWithListInput(BaseApi): def create_users_with_list_input( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -252,7 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: typing_extensions.Literal["application/json"] = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -264,7 +226,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -277,7 +239,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., stream: bool = False, @@ -287,7 +249,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = ..., stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -299,7 +261,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[RequestBody.Schemas.application_json,list, tuple, ], + body: typing.Union[request_body.application_json,list, tuple, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/request_body.py new file mode 100644 index 00000000000..c038ca7e1e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/request_body.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + + + + +class application_json( + schemas.ListSchema +): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['User']: + return User + + def __new__( + cls, + arg: typing.Union[typing.Tuple['User'], typing.List['User']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'application_json': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'User': + return super().__getitem__(i) + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py index 9be3b653934..7297c464701 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py @@ -30,6 +30,7 @@ from .. import path from . import response_for_400 from . import response_for_404 +from . import request_body @@ -64,20 +65,6 @@ class Params(RequiredParams, OptionalParams): required=True, ), ] - -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - _status_code_to_response = { '400': response_for_400.response, '404': response_for_404.response, @@ -88,7 +75,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -98,7 +85,7 @@ def _update_user_oapg( @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -109,7 +96,7 @@ def _update_user_oapg( @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -120,7 +107,7 @@ def _update_user_oapg( @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -132,7 +119,7 @@ def _update_user_oapg( def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -167,7 +154,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -204,7 +191,7 @@ class UpdateUser(BaseApi): @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -214,7 +201,7 @@ def update_user( @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -225,7 +212,7 @@ def update_user( @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -236,7 +223,7 @@ def update_user( @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -248,7 +235,7 @@ def update_user( def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -271,7 +258,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -281,7 +268,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -292,7 +279,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -303,7 +290,7 @@ def put( @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -315,7 +302,7 @@ def put( def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi index 0d42a4b931e..532245c817a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi @@ -29,6 +29,7 @@ from petstore_api.model.user import User from . import response_for_400 from . import response_for_404 +from . import request_body @@ -64,25 +65,11 @@ class RequestPathParameters: ), ] -class RequestBody: - class Schemas: - application_json = User - - parameter = api_client.RequestBody( - content={ - 'application/json': api_client.MediaType( - schema=Schemas.application_json - ), - }, - required=True, - ) - - class BaseApi(api_client.Api): @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -92,7 +79,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -103,7 +90,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -114,7 +101,7 @@ class BaseApi(api_client.Api): @typing.overload def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -126,7 +113,7 @@ class BaseApi(api_client.Api): def _update_user_oapg( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -161,7 +148,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = RequestBody.parameter.serialize(body, content_type) + serialized_data = request_body.parameter_oapg.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -198,7 +185,7 @@ class UpdateUser(BaseApi): @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -208,7 +195,7 @@ class UpdateUser(BaseApi): @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -219,7 +206,7 @@ class UpdateUser(BaseApi): @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -230,7 +217,7 @@ class UpdateUser(BaseApi): @typing.overload def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -242,7 +229,7 @@ class UpdateUser(BaseApi): def update_user( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -265,7 +252,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: typing_extensions.Literal["application/json"] = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -275,7 +262,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -286,7 +273,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), @@ -297,7 +284,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = ..., path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, @@ -309,7 +296,7 @@ class ApiForput(BaseApi): def put( self, - body: typing.Union[RequestBody.Schemas.application_json,], + body: typing.Union[request_body.application_json,], content_type: str = 'application/json', path_params: RequestPathParameters.Params = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body.py new file mode 100644 index 00000000000..44bdfbbd588 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from petstore_api import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + + +application_json = User + +parameter_oapg = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=application_json + ), + }, + required=True, +)