diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a95e21cb0cf..daef5f47de5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -7706,16 +7706,16 @@ public class DefaultCodegen implements CodegenConfig { Schema notSchema = schema.getNot(); CodegenProperty notProperty = null; if (notSchema != null) { - notProperty = fromProperty("NotSchema", notSchema, false); + notProperty = fromProperty("not_schema", notSchema, false); } List allOf = new ArrayList<>(); List oneOf = new ArrayList<>(); List anyOf = new ArrayList<>(); if (schema instanceof ComposedSchema) { ComposedSchema cs = (ComposedSchema) schema; - allOf = getComposedProperties(cs.getAllOf(), "allOf"); - oneOf = getComposedProperties(cs.getOneOf(), "oneOf"); - anyOf = getComposedProperties(cs.getAnyOf(), "anyOf"); + allOf = getComposedProperties(cs.getAllOf(), "all_of"); + oneOf = getComposedProperties(cs.getOneOf(), "one_of"); + anyOf = getComposedProperties(cs.getAnyOf(), "any_of"); } return new CodegenComposedSchemas( allOf, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars index 38b68c510c3..6ac38c906a3 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars @@ -145,6 +145,84 @@ class ParameterSerializerBase: def to_dict(name: str, value: str): return {name: value} + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + @classmethod def ref6570_expansion( cls, @@ -160,54 +238,37 @@ class ParameterSerializerBase: named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} var_name_piece = variable_name if named_parameter_expansion else '' if type(in_data) in {str, float, int}: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None: - return next(prefix_separator_iterator) + var_name_piece - elif item_value == '' and prefix_separator_iterator.separator == ';': - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) elif isinstance(in_data, none_type): # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return "" elif isinstance(in_data, list): - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) elif isinstance(in_data, dict): - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) # bool, bytes, etc raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) @@ -903,7 +964,6 @@ class ApiClient: """ _pool = None - __json_encoder = JSONEncoder() def __init__( self, @@ -1160,33 +1220,34 @@ class ApiClient: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) + if not auth_setting: + continue + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) {{#if hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - querys = tuple() - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers.add(key, value) -{{/if}} - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + querys = tuple() + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers.add(key, value) +{{/if}} + elif auth_setting['in'] == 'query': + """ TODO implement auth in query + need to pass in prefix_separator_iterator + and need to output resource_path with query params added + """ + raise ApiValueError("Auth in query not yet implemented") + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Api: diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars index d9fce78ac9a..456190c266a 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -1571,7 +1571,6 @@ class ComposedBase(Discriminable): arg, discriminated_cls, validation_metadata: ValidationMetadata, - path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] ): oneof_classes = [] path_to_schemas = defaultdict(set) @@ -1689,8 +1688,7 @@ class ComposedBase(Discriminable): other_path_to_schemas = cls.__get_oneof_class( arg, discriminated_cls=discriminated_cls, - validation_metadata=updated_vm, - path_to_schemas=path_to_schemas + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['anyOf']: diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 9a63e801a63..69476a84004 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -31,8 +31,8 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://petstore.swagger.io/v2' - - url: 'http://path-server-test.petstore.local/v2' + - url: 'https://petstore.swagger.io/v2' + - url: 'https://path-server-test.petstore.local/v2' post: tags: - pet diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py index 66e52cba296..dcca5a7514b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py @@ -149,6 +149,84 @@ class ParameterSerializerBase: def to_dict(name: str, value: str): return {name: value} + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + @classmethod def ref6570_expansion( cls, @@ -164,54 +242,37 @@ class ParameterSerializerBase: named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} var_name_piece = variable_name if named_parameter_expansion else '' if type(in_data) in {str, float, int}: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None: - return next(prefix_separator_iterator) + var_name_piece - elif item_value == '' and prefix_separator_iterator.separator == ';': - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) elif isinstance(in_data, none_type): # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return "" elif isinstance(in_data, list): - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) elif isinstance(in_data, dict): - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) # bool, bytes, etc raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) @@ -907,7 +968,6 @@ class ApiClient: """ _pool = None - __json_encoder = JSONEncoder() def __init__( self, @@ -1161,22 +1221,23 @@ class ApiClient: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + if not auth_setting: + continue + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) + elif auth_setting['in'] == 'query': + """ TODO implement auth in query + need to pass in prefix_separator_iterator + and need to output resource_path with query params added + """ + raise ApiValueError("Auth in query not yet implemented") + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Api: diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py index 5f2482fc088..6f0c865a804 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py @@ -91,7 +91,7 @@ class AdditionalpropertiesShouldNotLookInApplicators( # loading - class allOf_0( + class all_of_0( AnyTypeSchema ): foo = AnyTypeSchema @@ -102,7 +102,7 @@ class AdditionalpropertiesShouldNotLookInApplicators( foo: typing.Union[foo, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -112,7 +112,7 @@ class AdditionalpropertiesShouldNotLookInApplicators( ) return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py index 3a0dee40435..9e0a845425b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py @@ -90,7 +90,7 @@ class Allof( # loading - class allOf_0( + class all_of_0( AnyTypeSchema ): _required_property_names = { @@ -104,7 +104,7 @@ class Allof( bar: bar, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -114,7 +114,7 @@ class Allof( ) - class allOf_1( + class all_of_1( AnyTypeSchema ): _required_property_names = { @@ -128,7 +128,7 @@ class Allof( foo: foo, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -138,8 +138,8 @@ class Allof( ) return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py index ebb7195de0f..f8f82209f04 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py @@ -90,7 +90,7 @@ class AllofCombinedWithAnyofOneof( # loading - class allOf_0( + class all_of_0( _SchemaValidator( multiple_of=2, ), @@ -102,7 +102,7 @@ class AllofCombinedWithAnyofOneof( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -111,7 +111,7 @@ class AllofCombinedWithAnyofOneof( ) - class oneOf_0( + class one_of_0( _SchemaValidator( multiple_of=5, ), @@ -123,7 +123,7 @@ class AllofCombinedWithAnyofOneof( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_0': + ) -> 'one_of_0': return super().__new__( cls, *args, @@ -132,7 +132,7 @@ class AllofCombinedWithAnyofOneof( ) - class anyOf_0( + class any_of_0( _SchemaValidator( multiple_of=3, ), @@ -144,7 +144,7 @@ class AllofCombinedWithAnyofOneof( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_0': + ) -> 'any_of_0': return super().__new__( cls, *args, @@ -153,13 +153,13 @@ class AllofCombinedWithAnyofOneof( ) return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ - oneOf_0, + one_of_0, ], 'anyOf': [ - anyOf_0, + any_of_0, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py index 6115b79c0f2..6b725ef420e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py @@ -90,7 +90,7 @@ class AllofSimpleTypes( # loading - class allOf_0( + class all_of_0( _SchemaValidator( inclusive_maximum=30, ), @@ -102,7 +102,7 @@ class AllofSimpleTypes( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -111,7 +111,7 @@ class AllofSimpleTypes( ) - class allOf_1( + class all_of_1( _SchemaValidator( inclusive_minimum=20, ), @@ -123,7 +123,7 @@ class AllofSimpleTypes( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -132,8 +132,8 @@ class AllofSimpleTypes( ) return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py index 408b065e352..5a823f5b5e9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py @@ -94,7 +94,7 @@ class AllofWithBaseSchema( # loading - class allOf_0( + class all_of_0( AnyTypeSchema ): _required_property_names = { @@ -108,7 +108,7 @@ class AllofWithBaseSchema( foo: foo, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -118,7 +118,7 @@ class AllofWithBaseSchema( ) - class allOf_1( + class all_of_1( AnyTypeSchema ): _required_property_names = { @@ -132,7 +132,7 @@ class AllofWithBaseSchema( baz: baz, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -142,8 +142,8 @@ class AllofWithBaseSchema( ) return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py index 02678cbcd79..f38bf6f3926 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py @@ -88,10 +88,10 @@ class AllofWithOneEmptySchema( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py index a23acfe6b4e..78af6a9ae37 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py @@ -88,12 +88,12 @@ class AllofWithTheFirstEmptySchema( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema - allOf_1 = NumberSchema + all_of_0 = AnyTypeSchema + all_of_1 = NumberSchema return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py index 82d9ce92d02..ef7e080a995 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py @@ -88,12 +88,12 @@ class AllofWithTheLastEmptySchema( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = NumberSchema - allOf_1 = AnyTypeSchema + all_of_0 = NumberSchema + all_of_1 = AnyTypeSchema return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py index b690851c8bb..dce2e854f53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py @@ -88,12 +88,12 @@ class AllofWithTwoEmptySchemas( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema - allOf_1 = AnyTypeSchema + all_of_0 = AnyTypeSchema + all_of_1 = AnyTypeSchema return { 'allOf': [ - allOf_0, - allOf_1, + all_of_0, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py index b1d4591b558..abefcd4238f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py @@ -88,10 +88,10 @@ class Anyof( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - anyOf_0 = IntSchema + any_of_0 = IntSchema - class anyOf_1( + class any_of_1( _SchemaValidator( inclusive_minimum=2, ), @@ -103,7 +103,7 @@ class Anyof( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_1': + ) -> 'any_of_1': return super().__new__( cls, *args, @@ -116,8 +116,8 @@ class Anyof( 'oneOf': [ ], 'anyOf': [ - anyOf_0, - anyOf_1, + any_of_0, + any_of_1, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py index c575ad2f2bb..b8522a1062e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py @@ -90,7 +90,7 @@ class AnyofComplexTypes( # loading - class anyOf_0( + class any_of_0( AnyTypeSchema ): _required_property_names = { @@ -104,7 +104,7 @@ class AnyofComplexTypes( bar: bar, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_0': + ) -> 'any_of_0': return super().__new__( cls, *args, @@ -114,7 +114,7 @@ class AnyofComplexTypes( ) - class anyOf_1( + class any_of_1( AnyTypeSchema ): _required_property_names = { @@ -128,7 +128,7 @@ class AnyofComplexTypes( foo: foo, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_1': + ) -> 'any_of_1': return super().__new__( cls, *args, @@ -142,8 +142,8 @@ class AnyofComplexTypes( 'oneOf': [ ], 'anyOf': [ - anyOf_0, - anyOf_1, + any_of_0, + any_of_1, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py index 48f7374cb29..8a47aed7163 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py @@ -91,7 +91,7 @@ class AnyofWithBaseSchema( # loading - class anyOf_0( + class any_of_0( _SchemaValidator( max_length=2, ), @@ -103,7 +103,7 @@ class AnyofWithBaseSchema( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_0': + ) -> 'any_of_0': return super().__new__( cls, *args, @@ -112,7 +112,7 @@ class AnyofWithBaseSchema( ) - class anyOf_1( + class any_of_1( _SchemaValidator( min_length=4, ), @@ -124,7 +124,7 @@ class AnyofWithBaseSchema( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_1': + ) -> 'any_of_1': return super().__new__( cls, *args, @@ -137,8 +137,8 @@ class AnyofWithBaseSchema( 'oneOf': [ ], 'anyOf': [ - anyOf_0, - anyOf_1, + any_of_0, + any_of_1, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py index ba318600bd4..c68ede29d28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py @@ -88,16 +88,16 @@ class AnyofWithOneEmptySchema( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - anyOf_0 = NumberSchema - anyOf_1 = AnyTypeSchema + any_of_0 = NumberSchema + any_of_1 = AnyTypeSchema return { 'allOf': [ ], 'oneOf': [ ], 'anyOf': [ - anyOf_0, - anyOf_1, + any_of_0, + any_of_1, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py index ccdc7ddc587..122f5b7854b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py @@ -93,7 +93,7 @@ class ForbiddenProperty( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = AnyTypeSchema + not_schema = AnyTypeSchema return { 'allOf': [ ], @@ -102,7 +102,7 @@ class ForbiddenProperty( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py index 49841aa5162..b876c72078d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py @@ -88,7 +88,7 @@ class ModelNot( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = IntSchema + not_schema = IntSchema return { 'allOf': [ ], @@ -97,7 +97,7 @@ class ModelNot( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py index 41f27e3664e..0a8b1d0d356 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py @@ -90,7 +90,7 @@ class NestedAllofToCheckValidationSemantics( # loading - class allOf_0( + class all_of_0( ComposedSchema ): @@ -105,10 +105,10 @@ class NestedAllofToCheckValidationSemantics( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = NoneSchema + all_of_0 = NoneSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -123,7 +123,7 @@ class NestedAllofToCheckValidationSemantics( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_0': + ) -> 'all_of_0': return super().__new__( cls, *args, @@ -132,7 +132,7 @@ class NestedAllofToCheckValidationSemantics( ) return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py index 6c01a59bcc8..99edb748805 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py @@ -90,7 +90,7 @@ class NestedAnyofToCheckValidationSemantics( # loading - class anyOf_0( + class any_of_0( ComposedSchema ): @@ -105,14 +105,14 @@ class NestedAnyofToCheckValidationSemantics( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - anyOf_0 = NoneSchema + any_of_0 = NoneSchema return { 'allOf': [ ], 'oneOf': [ ], 'anyOf': [ - anyOf_0, + any_of_0, ], 'not': None @@ -123,7 +123,7 @@ class NestedAnyofToCheckValidationSemantics( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'anyOf_0': + ) -> 'any_of_0': return super().__new__( cls, *args, @@ -136,7 +136,7 @@ class NestedAnyofToCheckValidationSemantics( 'oneOf': [ ], 'anyOf': [ - anyOf_0, + any_of_0, ], 'not': None diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py index 4f7280c4e02..7a0d8bb3711 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py @@ -90,7 +90,7 @@ class NestedOneofToCheckValidationSemantics( # loading - class oneOf_0( + class one_of_0( ComposedSchema ): @@ -105,12 +105,12 @@ class NestedOneofToCheckValidationSemantics( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_0 = NoneSchema + one_of_0 = NoneSchema return { 'allOf': [ ], 'oneOf': [ - oneOf_0, + one_of_0, ], 'anyOf': [ ], @@ -123,7 +123,7 @@ class NestedOneofToCheckValidationSemantics( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_0': + ) -> 'one_of_0': return super().__new__( cls, *args, @@ -134,7 +134,7 @@ class NestedOneofToCheckValidationSemantics( 'allOf': [ ], 'oneOf': [ - oneOf_0, + one_of_0, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py index a6b6292f11d..7457e5eaf9a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py @@ -90,7 +90,7 @@ class NotMoreComplexSchema( # loading - class NotSchema( + class not_schema( DictSchema ): foo = StrSchema @@ -102,7 +102,7 @@ class NotMoreComplexSchema( foo: typing.Union[foo, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'NotSchema': + ) -> 'not_schema': return super().__new__( cls, *args, @@ -118,7 +118,7 @@ class NotMoreComplexSchema( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py index 70eb394c437..8d55aac39f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py @@ -88,10 +88,10 @@ class Oneof( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_0 = IntSchema + one_of_0 = IntSchema - class oneOf_1( + class one_of_1( _SchemaValidator( inclusive_minimum=2, ), @@ -103,7 +103,7 @@ class Oneof( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_1': + ) -> 'one_of_1': return super().__new__( cls, *args, @@ -114,8 +114,8 @@ class Oneof( 'allOf': [ ], 'oneOf': [ - oneOf_0, - oneOf_1, + one_of_0, + one_of_1, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py index fe640103206..a2c54eceb35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py @@ -90,7 +90,7 @@ class OneofComplexTypes( # loading - class oneOf_0( + class one_of_0( AnyTypeSchema ): _required_property_names = { @@ -104,7 +104,7 @@ class OneofComplexTypes( bar: bar, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_0': + ) -> 'one_of_0': return super().__new__( cls, *args, @@ -114,7 +114,7 @@ class OneofComplexTypes( ) - class oneOf_1( + class one_of_1( AnyTypeSchema ): _required_property_names = { @@ -128,7 +128,7 @@ class OneofComplexTypes( foo: foo, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_1': + ) -> 'one_of_1': return super().__new__( cls, *args, @@ -140,8 +140,8 @@ class OneofComplexTypes( 'allOf': [ ], 'oneOf': [ - oneOf_0, - oneOf_1, + one_of_0, + one_of_1, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py index 09bf4d2d52b..27157345bb8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py @@ -91,7 +91,7 @@ class OneofWithBaseSchema( # loading - class oneOf_0( + class one_of_0( _SchemaValidator( min_length=2, ), @@ -103,7 +103,7 @@ class OneofWithBaseSchema( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_0': + ) -> 'one_of_0': return super().__new__( cls, *args, @@ -112,7 +112,7 @@ class OneofWithBaseSchema( ) - class oneOf_1( + class one_of_1( _SchemaValidator( max_length=4, ), @@ -124,7 +124,7 @@ class OneofWithBaseSchema( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_1': + ) -> 'one_of_1': return super().__new__( cls, *args, @@ -135,8 +135,8 @@ class OneofWithBaseSchema( 'allOf': [ ], 'oneOf': [ - oneOf_0, - oneOf_1, + one_of_0, + one_of_1, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py index 1ccdc627c94..03231ab1592 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py @@ -88,14 +88,14 @@ class OneofWithEmptySchema( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_0 = NumberSchema - oneOf_1 = AnyTypeSchema + one_of_0 = NumberSchema + one_of_1 = AnyTypeSchema return { 'allOf': [ ], 'oneOf': [ - oneOf_0, - oneOf_1, + one_of_0, + one_of_1, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py index b03fc2d6377..1c2607f2dae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py @@ -91,7 +91,7 @@ class OneofWithRequired( # loading - class oneOf_0( + class one_of_0( AnyTypeSchema ): _required_property_names = { @@ -104,7 +104,7 @@ class OneofWithRequired( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_0': + ) -> 'one_of_0': return super().__new__( cls, *args, @@ -113,7 +113,7 @@ class OneofWithRequired( ) - class oneOf_1( + class one_of_1( AnyTypeSchema ): _required_property_names = { @@ -126,7 +126,7 @@ class OneofWithRequired( *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_1': + ) -> 'one_of_1': return super().__new__( cls, *args, @@ -137,8 +137,8 @@ class OneofWithRequired( 'allOf': [ ], 'oneOf': [ - oneOf_0, - oneOf_1, + one_of_0, + one_of_1, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py index e905896ec06..f398402853c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py @@ -88,7 +88,7 @@ class SchemaForRequestBodyApplicationJson( # loading - class NotSchema( + class not_schema( DictSchema ): foo = StrSchema @@ -100,7 +100,7 @@ class SchemaForRequestBodyApplicationJson( foo: typing.Union[foo, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'NotSchema': + ) -> 'not_schema': return super().__new__( cls, *args, @@ -116,7 +116,7 @@ class SchemaForRequestBodyApplicationJson( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py index 38a3201f0fb..706fc6f255a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py @@ -86,7 +86,7 @@ class SchemaForRequestBodyApplicationJson( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = IntSchema + not_schema = IntSchema return { 'allOf': [ ], @@ -95,7 +95,7 @@ class SchemaForRequestBodyApplicationJson( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py index d6af496d2c6..a75a347f5b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py @@ -87,7 +87,7 @@ class SchemaFor200ResponseBodyApplicationJson( # loading - class NotSchema( + class not_schema( DictSchema ): foo = StrSchema @@ -99,7 +99,7 @@ class SchemaFor200ResponseBodyApplicationJson( foo: typing.Union[foo, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'NotSchema': + ) -> 'not_schema': return super().__new__( cls, *args, @@ -115,7 +115,7 @@ class SchemaFor200ResponseBodyApplicationJson( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py index b823f7c7dfc..3840b9327ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py @@ -85,7 +85,7 @@ class SchemaFor200ResponseBodyApplicationJson( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = IntSchema + not_schema = IntSchema return { 'allOf': [ ], @@ -94,7 +94,7 @@ class SchemaFor200ResponseBodyApplicationJson( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py index ea23eb54fef..78cbd7b4f4f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py @@ -1578,7 +1578,6 @@ class ComposedBase(Discriminable): arg, discriminated_cls, validation_metadata: ValidationMetadata, - path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] ): oneof_classes = [] path_to_schemas = defaultdict(set) @@ -1696,8 +1695,7 @@ class ComposedBase(Discriminable): other_path_to_schemas = cls.__get_oneof_class( arg, discriminated_cls=discriminated_cls, - validation_metadata=updated_vm, - path_to_schemas=path_to_schemas + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['anyOf']: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index fcd76cc5ca8..3afd47b60cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -149,6 +149,84 @@ class ParameterSerializerBase: def to_dict(name: str, value: str): return {name: value} + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + @classmethod def ref6570_expansion( cls, @@ -164,54 +242,37 @@ class ParameterSerializerBase: named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} var_name_piece = variable_name if named_parameter_expansion else '' if type(in_data) in {str, float, int}: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None: - return next(prefix_separator_iterator) + var_name_piece - elif item_value == '' and prefix_separator_iterator.separator == ';': - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) elif isinstance(in_data, none_type): # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 return "" elif isinstance(in_data, list): - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) elif isinstance(in_data, dict): - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion ) # bool, bytes, etc raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) @@ -907,7 +968,6 @@ class ApiClient: """ _pool = None - __json_encoder = JSONEncoder() def __init__( self, @@ -1161,31 +1221,32 @@ class ApiClient: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(auth_setting['key'], auth_setting['value']) - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - querys = tuple() - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers.add(key, value) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") + if not auth_setting: + continue + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + querys = tuple() + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers.add(key, value) + elif auth_setting['in'] == 'query': + """ TODO implement auth in query + need to pass in prefix_separator_iterator + and need to output resource_path with query params added + """ + raise ApiValueError("Auth in query not yet implemented") + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Api: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py index d3b1f5179c1..885b1b96798 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py @@ -88,7 +88,7 @@ class AnyTypeNotString( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = StrSchema + not_schema = StrSchema return { 'allOf': [ ], @@ -97,7 +97,7 @@ class AnyTypeNotString( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index e77e96fcfa7..59bdb64b372 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -90,7 +90,7 @@ class Cat( # loading - class allOf_1( + class all_of_1( DictSchema ): declawed = BoolSchema @@ -102,7 +102,7 @@ class Cat( declawed: typing.Union[declawed, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -113,7 +113,7 @@ class Cat( return { 'allOf': [ Animal, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 7a8751c2c11..e46622a4019 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -90,7 +90,7 @@ class ChildCat( # loading - class allOf_1( + class all_of_1( DictSchema ): name = StrSchema @@ -102,7 +102,7 @@ class ChildCat( name: typing.Union[name, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -113,7 +113,7 @@ class ChildCat( return { 'allOf': [ ParentPet, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index f0ed8578311..27e37eccac6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -90,7 +90,7 @@ class ComplexQuadrilateral( # loading - class allOf_1( + class all_of_1( DictSchema ): @@ -116,7 +116,7 @@ class ComplexQuadrilateral( quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -127,7 +127,7 @@ class ComplexQuadrilateral( return { 'allOf': [ QuadrilateralInterface, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py index c0fa339d9fd..6f0ec3ddc2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -88,49 +88,49 @@ class ComposedAnyOfDifferentTypesNoValidations( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - anyOf_0 = DictSchema - anyOf_1 = DateSchema - anyOf_2 = DateTimeSchema - anyOf_3 = BinarySchema - anyOf_4 = StrSchema - anyOf_5 = StrSchema - anyOf_6 = DictSchema - anyOf_7 = BoolSchema - anyOf_8 = NoneSchema + any_of_0 = DictSchema + any_of_1 = DateSchema + any_of_2 = DateTimeSchema + any_of_3 = BinarySchema + any_of_4 = StrSchema + any_of_5 = StrSchema + any_of_6 = DictSchema + any_of_7 = BoolSchema + any_of_8 = NoneSchema - class anyOf_9( + class any_of_9( ListSchema ): _items = AnyTypeSchema - anyOf_10 = NumberSchema - anyOf_11 = Float32Schema - anyOf_12 = Float64Schema - anyOf_13 = IntSchema - anyOf_14 = Int32Schema - anyOf_15 = Int64Schema + any_of_10 = NumberSchema + any_of_11 = Float32Schema + any_of_12 = Float64Schema + any_of_13 = IntSchema + any_of_14 = Int32Schema + any_of_15 = Int64Schema return { 'allOf': [ ], 'oneOf': [ ], 'anyOf': [ - anyOf_0, - anyOf_1, - anyOf_2, - anyOf_3, - anyOf_4, - anyOf_5, - anyOf_6, - anyOf_7, - anyOf_8, - anyOf_9, - anyOf_10, - anyOf_11, - anyOf_12, - anyOf_13, - anyOf_14, - anyOf_15, + any_of_0, + any_of_1, + any_of_2, + any_of_3, + any_of_4, + any_of_5, + any_of_6, + any_of_7, + any_of_8, + any_of_9, + any_of_10, + any_of_11, + any_of_12, + any_of_13, + any_of_14, + any_of_15, ], 'not': None diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py index c7fae992ce8..e10ccf6b241 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -89,10 +89,10 @@ class ComposedBool( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py index c0fbf1abdeb..b2b2e0678d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -89,10 +89,10 @@ class ComposedNone( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py index 6c53edc3429..87202b73eb8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -89,10 +89,10 @@ class ComposedNumber( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py index 3579c7965d7..13aaa49b717 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -89,10 +89,10 @@ class ComposedObject( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py index 3e27e2a996f..d3e1baa38e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -90,11 +90,11 @@ class ComposedOneOfDifferentTypes( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_2 = NoneSchema - oneOf_3 = DateSchema + one_of_2 = NoneSchema + one_of_3 = DateSchema - class oneOf_4( + class one_of_4( _SchemaValidator( max_properties=4, min_properties=4, @@ -108,7 +108,7 @@ class ComposedOneOfDifferentTypes( *args: typing.Union[dict, frozendict, ], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'oneOf_4': + ) -> 'one_of_4': return super().__new__( cls, *args, @@ -117,7 +117,7 @@ class ComposedOneOfDifferentTypes( ) - class oneOf_5( + class one_of_5( _SchemaValidator( max_items=4, min_items=4, @@ -127,7 +127,7 @@ class ComposedOneOfDifferentTypes( _items = AnyTypeSchema - class oneOf_6( + class one_of_6( _SchemaValidator( regex=[{ 'pattern': r'^2020.*', # noqa: E501 @@ -142,11 +142,11 @@ class ComposedOneOfDifferentTypes( 'oneOf': [ NumberWithValidations, Animal, - oneOf_2, - oneOf_3, - oneOf_4, - oneOf_5, - oneOf_6, + one_of_2, + one_of_3, + one_of_4, + one_of_5, + one_of_6, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py index da33e5202f4..1c739ac3cf1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -89,10 +89,10 @@ class ComposedString( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - allOf_0 = AnyTypeSchema + all_of_0 = AnyTypeSchema return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index 130512a669e..8bb69282e3f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -90,7 +90,7 @@ class Dog( # loading - class allOf_1( + class all_of_1( DictSchema ): breed = StrSchema @@ -102,7 +102,7 @@ class Dog( breed: typing.Union[breed, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -113,7 +113,7 @@ class Dog( return { 'allOf': [ Animal, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 335a9479883..70784a497cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -90,7 +90,7 @@ class EquilateralTriangle( # loading - class allOf_1( + class all_of_1( DictSchema ): @@ -116,7 +116,7 @@ class EquilateralTriangle( triangleType: typing.Union[triangleType, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -127,7 +127,7 @@ class EquilateralTriangle( return { 'allOf': [ TriangleInterface, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 3458ea63f6a..94fe77750dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -88,12 +88,12 @@ class FruitReq( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_0 = NoneSchema + one_of_0 = NoneSchema return { 'allOf': [ ], 'oneOf': [ - oneOf_0, + one_of_0, AppleReq, BananaReq, ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index e5f85b145e9..3168ac85313 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -90,7 +90,7 @@ class IsoscelesTriangle( # loading - class allOf_1( + class all_of_1( DictSchema ): @@ -116,7 +116,7 @@ class IsoscelesTriangle( triangleType: typing.Union[triangleType, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -127,7 +127,7 @@ class IsoscelesTriangle( return { 'allOf': [ TriangleInterface, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index c24703964e7..c5f29819849 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -90,14 +90,14 @@ class NullableShape( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_2 = NoneSchema + one_of_2 = NoneSchema return { 'allOf': [ ], 'oneOf': [ Triangle, Quadrilateral, - oneOf_2, + one_of_2, ], 'anyOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py index caff3025fa7..77c106cd10a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py @@ -95,7 +95,7 @@ class ObjectWithInlineCompositionProperty( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -104,7 +104,7 @@ class ObjectWithInlineCompositionProperty( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 85522716d0e..62c8afa8de3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -90,7 +90,7 @@ class ScaleneTriangle( # loading - class allOf_1( + class all_of_1( DictSchema ): @@ -116,7 +116,7 @@ class ScaleneTriangle( triangleType: typing.Union[triangleType, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -127,7 +127,7 @@ class ScaleneTriangle( return { 'allOf': [ TriangleInterface, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 71049a63149..e08380258fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -100,12 +100,12 @@ class ShapeOrNull( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - oneOf_0 = NoneSchema + one_of_0 = NoneSchema return { 'allOf': [ ], 'oneOf': [ - oneOf_0, + one_of_0, Triangle, Quadrilateral, ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index 5ae014d0ad5..9f2ad6437bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -90,7 +90,7 @@ class SimpleQuadrilateral( # loading - class allOf_1( + class all_of_1( DictSchema ): @@ -116,7 +116,7 @@ class SimpleQuadrilateral( quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schema], - ) -> 'allOf_1': + ) -> 'all_of_1': return super().__new__( cls, *args, @@ -127,7 +127,7 @@ class SimpleQuadrilateral( return { 'allOf': [ QuadrilateralInterface, - allOf_1, + all_of_1, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index d640593bbd6..ccfd2f66c8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -124,7 +124,7 @@ class User( # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading - NotSchema = NoneSchema + not_schema = NoneSchema return { 'allOf': [ ], @@ -133,7 +133,7 @@ class User( 'anyOf': [ ], 'not': - NotSchema + not_schema } def __new__( diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py index 2c61da8a576..1889ba7a731 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py @@ -88,7 +88,7 @@ class CompositionAtRootSchema( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -97,7 +97,7 @@ class CompositionAtRootSchema( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -143,7 +143,7 @@ class CompositionInPropertySchema( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -152,7 +152,7 @@ class CompositionInPropertySchema( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -241,7 +241,7 @@ class SchemaForRequestBodyApplicationJson( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -250,7 +250,7 @@ class SchemaForRequestBodyApplicationJson( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -296,7 +296,7 @@ class SchemaForRequestBodyMultipartFormData( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -305,7 +305,7 @@ class SchemaForRequestBodyMultipartFormData( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -372,7 +372,7 @@ class SchemaFor200ResponseBodyApplicationJson( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -381,7 +381,7 @@ class SchemaFor200ResponseBodyApplicationJson( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], @@ -427,7 +427,7 @@ class SchemaFor200ResponseBodyMultipartFormData( # loading - class allOf_0( + class all_of_0( _SchemaValidator( min_length=1, ), @@ -436,7 +436,7 @@ class SchemaFor200ResponseBodyMultipartFormData( pass return { 'allOf': [ - allOf_0, + all_of_0, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py index 1922b95dd7e..9911a88a849 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py @@ -90,11 +90,11 @@ _auth = [ ] _servers = ( { - 'url': "http://petstore.swagger.io/v2", + 'url': "https://petstore.swagger.io/v2", 'description': "No description provided", }, { - 'url': "http://path-server-test.petstore.local/v2", + 'url': "https://path-server-test.petstore.local/v2", 'description': "No description provided", }, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.py index 63daa070fdb..f70fae43607 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.py @@ -90,11 +90,11 @@ _auth = [ ] _servers = ( { - 'url': "http://petstore.swagger.io/v2", + 'url': "https://petstore.swagger.io/v2", 'description': "No description provided", }, { - 'url': "http://path-server-test.petstore.local/v2", + 'url': "https://path-server-test.petstore.local/v2", 'description': "No description provided", }, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py index c9915c8474f..4380d5eac3b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -1578,7 +1578,6 @@ class ComposedBase(Discriminable): arg, discriminated_cls, validation_metadata: ValidationMetadata, - path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] ): oneof_classes = [] path_to_schemas = defaultdict(set) @@ -1696,8 +1695,7 @@ class ComposedBase(Discriminable): other_path_to_schemas = cls.__get_oneof_class( arg, discriminated_cls=discriminated_cls, - validation_metadata=updated_vm, - path_to_schemas=path_to_schemas + validation_metadata=updated_vm ) update(path_to_schemas, other_path_to_schemas) if cls._composed_schemas['anyOf']: diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py index d0d1e9348f2..1d11ed6cae2 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py @@ -24,7 +24,7 @@ class ConfigurationTests(unittest.TestCase): def test_configuration(self): config = petstore_api.Configuration() - config.host = 'http://localhost/' + config.host = 'https://localhost/' config.disabled_client_side_validations = ("multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum," "maxLength,minLength,pattern,maxItems,minItems") @@ -42,7 +42,7 @@ class ConfigurationTests(unittest.TestCase): api.add_pet({'name': 'pet', 'photoUrls': []}) mock_request.assert_called_with( 'POST', - 'http://path-server-test.petstore.local/v2/pet', + 'https://path-server-test.petstore.local/v2/pet', headers=HTTPHeaderDict({ 'Content-Type': 'application/json', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'