From a294456695d79fa479a8a76cefa31b55712d099e Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 30 Aug 2022 11:51:31 -0700 Subject: [PATCH] [python-experimental] adds dict["key_name"] type hints (#13309) * Uses frozendict module import in schemas and api_client * Regnerates sample * Adds overload type hints * Adds __getitem__ methods for invalidly name properties * Fixes code that instantiates referenced schemas in object payloads * Fixes getitem literals containing control charaters * Sorts params by required, adds type hints for properties with addProps turned off * Unit test spec sample regenerated * Adds stub files for models and endpoints * Omitting some endpoint info from endpoint stub files * Removes more from endpoint stub * Deletes all except for schema definition in endpoint stubs * Removes simple validations from stubs * Removes endpoint parameter deifnition from endpoints stubs * Removes unnecessary ../ stub variable access * Samples regenerated * Samples regenerated, fixed handling of invalidly named properties * Samples regenerated * Reverts version files --- .../PythonExperimentalClientCodegen.java | 22 +- .../python-experimental/api_client.handlebars | 22 +- .../python-experimental/endpoint.handlebars | 20 + .../endpoint_args.handlebars | 8 +- .../endpoint_stub.handlebars | 1 + .../python-experimental/model.handlebars | 3 - .../python-experimental/model_stub.handlebars | 1 + .../model_templates/dict_partial.handlebars | 9 + .../imports_schema_types.handlebars | 3 +- ...property_getitems_with_addprops.handlebars | 42 ++ ...perty_getitems_without_addprops.handlebars | 30 + .../property_type_hints.handlebars | 5 + .../model_templates/schema.handlebars | 14 - .../schema_composed_or_anytype.handlebars | 4 +- .../model_templates/schema_dict.handlebars | 4 +- .../model_templates/schema_list.handlebars | 4 +- .../schema_python_types.handlebars | 2 +- .../model_templates/schema_simple.handlebars | 9 + .../python-experimental/schema_doc.handlebars | 2 +- .../python-experimental/schemas.handlebars | 115 ++-- .../.openapi-generator/FILES | 86 +++ .../docs/apis/tags/ContentTypeJsonApi.md | 4 +- .../docs/apis/tags/OperationRequestBodyApi.md | 2 +- .../docs/apis/tags/PathPostApi.md | 4 +- .../docs/apis/tags/RequiredApi.md | 4 +- .../ResponseContentContentTypeSchemaApi.md | 2 +- .../models/RequiredWithEscapedCharacters.md | 2 +- .../unit_test_api/api_client.py | 22 +- ...s_allows_a_schema_which_should_validate.py | 26 +- ..._allows_a_schema_which_should_validate.pyi | 73 +++ ...tionalproperties_are_allowed_by_default.py | 28 +- ...ionalproperties_are_allowed_by_default.pyi | 74 +++ ...dditionalproperties_can_exist_by_itself.py | 12 +- ...ditionalproperties_can_exist_by_itself.pyi | 53 ++ ...operties_should_not_look_in_applicators.py | 28 +- ...perties_should_not_look_in_applicators.pyi | 108 ++++ .../unit_test_api/model/allof.py | 42 +- .../unit_test_api/model/allof.pyi | 154 +++++ .../model/allof_combined_with_anyof_oneof.py | 38 +- .../model/allof_combined_with_anyof_oneof.pyi | 180 ++++++ .../unit_test_api/model/allof_simple_types.py | 30 +- .../model/allof_simple_types.pyi | 124 ++++ .../model/allof_with_base_schema.py | 48 +- .../model/allof_with_base_schema.pyi | 169 ++++++ .../model/allof_with_one_empty_schema.py | 14 +- .../model/allof_with_one_empty_schema.pyi | 70 +++ .../allof_with_the_first_empty_schema.py | 14 +- .../allof_with_the_first_empty_schema.pyi | 72 +++ .../model/allof_with_the_last_empty_schema.py | 14 +- .../allof_with_the_last_empty_schema.pyi | 72 +++ .../model/allof_with_two_empty_schemas.py | 14 +- .../model/allof_with_two_empty_schemas.pyi | 72 +++ .../unit_test_api/model/anyof.py | 22 +- .../unit_test_api/model/anyof.pyi | 98 +++ .../model/anyof_complex_types.py | 42 +- .../model/anyof_complex_types.pyi | 154 +++++ .../model/anyof_with_base_schema.py | 22 +- .../model/anyof_with_base_schema.pyi | 118 ++++ .../model/anyof_with_one_empty_schema.py | 14 +- .../model/anyof_with_one_empty_schema.pyi | 72 +++ .../model/array_type_matches_arrays.py | 10 +- .../model/array_type_matches_arrays.pyi | 50 ++ .../model/boolean_type_matches_booleans.py | 6 +- .../model/boolean_type_matches_booleans.pyi | 23 + .../unit_test_api/model/by_int.py | 14 +- .../unit_test_api/model/by_int.pyi | 54 ++ .../unit_test_api/model/by_number.py | 14 +- .../unit_test_api/model/by_number.pyi | 54 ++ .../unit_test_api/model/by_small_number.py | 14 +- .../unit_test_api/model/by_small_number.pyi | 54 ++ .../unit_test_api/model/date_time_format.py | 6 +- .../unit_test_api/model/date_time_format.pyi | 23 + .../unit_test_api/model/email_format.py | 6 +- .../unit_test_api/model/email_format.pyi | 23 + .../model/enum_with0_does_not_match_false.py | 6 +- .../model/enum_with0_does_not_match_false.pyi | 42 ++ .../model/enum_with1_does_not_match_true.py | 6 +- .../model/enum_with1_does_not_match_true.pyi | 42 ++ .../model/enum_with_escaped_characters.py | 6 +- .../model/enum_with_escaped_characters.pyi | 48 ++ .../model/enum_with_false_does_not_match0.py | 6 +- .../model/enum_with_false_does_not_match0.pyi | 42 ++ .../model/enum_with_true_does_not_match1.py | 6 +- .../model/enum_with_true_does_not_match1.pyi | 42 ++ .../model/enums_in_properties.py | 54 +- .../model/enums_in_properties.pyi | 104 ++++ .../unit_test_api/model/forbidden_property.py | 30 +- .../model/forbidden_property.pyi | 93 +++ .../unit_test_api/model/hostname_format.py | 6 +- .../unit_test_api/model/hostname_format.pyi | 23 + .../model/integer_type_matches_integers.py | 6 +- .../model/integer_type_matches_integers.pyi | 23 + ...not_raise_error_when_float_division_inf.py | 6 +- ...ot_raise_error_when_float_division_inf.pyi | 33 + .../model/invalid_string_value_for_default.py | 20 +- .../invalid_string_value_for_default.pyi | 71 +++ .../unit_test_api/model/ipv4_format.py | 6 +- .../unit_test_api/model/ipv4_format.pyi | 23 + .../unit_test_api/model/ipv6_format.py | 6 +- .../unit_test_api/model/ipv6_format.pyi | 23 + .../model/json_pointer_format.py | 6 +- .../model/json_pointer_format.pyi | 23 + .../unit_test_api/model/maximum_validation.py | 14 +- .../model/maximum_validation.pyi | 54 ++ ...aximum_validation_with_unsigned_integer.py | 14 +- ...ximum_validation_with_unsigned_integer.pyi | 54 ++ .../model/maxitems_validation.py | 14 +- .../model/maxitems_validation.pyi | 54 ++ .../model/maxlength_validation.py | 14 +- .../model/maxlength_validation.pyi | 54 ++ ...axproperties0_means_the_object_is_empty.py | 14 +- ...xproperties0_means_the_object_is_empty.pyi | 54 ++ .../model/maxproperties_validation.py | 14 +- .../model/maxproperties_validation.pyi | 54 ++ .../unit_test_api/model/minimum_validation.py | 14 +- .../model/minimum_validation.pyi | 54 ++ .../minimum_validation_with_signed_integer.py | 14 +- ...minimum_validation_with_signed_integer.pyi | 54 ++ .../model/minitems_validation.py | 14 +- .../model/minitems_validation.pyi | 54 ++ .../model/minlength_validation.py | 14 +- .../model/minlength_validation.pyi | 54 ++ .../model/minproperties_validation.py | 14 +- .../model/minproperties_validation.pyi | 54 ++ .../unit_test_api/model/model_not.py | 14 +- .../unit_test_api/model/model_not.pyi | 55 ++ ...ted_allof_to_check_validation_semantics.py | 22 +- ...ed_allof_to_check_validation_semantics.pyi | 112 ++++ ...ted_anyof_to_check_validation_semantics.py | 22 +- ...ed_anyof_to_check_validation_semantics.pyi | 112 ++++ .../unit_test_api/model/nested_items.py | 14 +- .../unit_test_api/model/nested_items.pyi | 116 ++++ ...ted_oneof_to_check_validation_semantics.py | 22 +- ...ed_oneof_to_check_validation_semantics.pyi | 112 ++++ .../model/not_more_complex_schema.py | 28 +- .../model/not_more_complex_schema.pyi | 92 +++ .../model/nul_characters_in_strings.py | 6 +- .../model/nul_characters_in_strings.pyi | 42 ++ .../null_type_matches_only_the_null_object.py | 6 +- ...null_type_matches_only_the_null_object.pyi | 23 + .../model/number_type_matches_numbers.py | 6 +- .../model/number_type_matches_numbers.pyi | 23 + .../model/object_properties_validation.py | 24 +- .../model/object_properties_validation.pyi | 74 +++ .../unit_test_api/model/oneof.py | 22 +- .../unit_test_api/model/oneof.pyi | 98 +++ .../model/oneof_complex_types.py | 42 +- .../model/oneof_complex_types.pyi | 154 +++++ .../model/oneof_with_base_schema.py | 22 +- .../model/oneof_with_base_schema.pyi | 118 ++++ .../model/oneof_with_empty_schema.py | 14 +- .../model/oneof_with_empty_schema.pyi | 72 +++ .../model/oneof_with_required.py | 42 +- .../model/oneof_with_required.pyi | 151 +++++ .../model/pattern_is_not_anchored.py | 14 +- .../model/pattern_is_not_anchored.pyi | 54 ++ .../unit_test_api/model/pattern_validation.py | 14 +- .../model/pattern_validation.pyi | 54 ++ .../properties_with_escaped_characters.py | 122 ++-- .../properties_with_escaped_characters.pyi | 88 +++ ...perty_named_ref_that_is_not_a_reference.py | 32 +- ...erty_named_ref_that_is_not_a_reference.pyi | 63 ++ .../model/ref_in_additionalproperties.py | 12 +- .../model/ref_in_additionalproperties.pyi | 59 ++ .../unit_test_api/model/ref_in_allof.py | 14 +- .../unit_test_api/model/ref_in_allof.pyi | 71 +++ .../unit_test_api/model/ref_in_anyof.py | 14 +- .../unit_test_api/model/ref_in_anyof.pyi | 71 +++ .../unit_test_api/model/ref_in_items.py | 8 +- .../unit_test_api/model/ref_in_items.pyi | 56 ++ .../unit_test_api/model/ref_in_not.py | 14 +- .../unit_test_api/model/ref_in_not.pyi | 61 ++ .../unit_test_api/model/ref_in_oneof.py | 14 +- .../unit_test_api/model/ref_in_oneof.pyi | 71 +++ .../unit_test_api/model/ref_in_property.py | 20 +- .../unit_test_api/model/ref_in_property.pyi | 72 +++ .../model/required_default_validation.py | 22 +- .../model/required_default_validation.pyi | 66 ++ .../model/required_validation.py | 28 +- .../model/required_validation.pyi | 77 +++ .../model/required_with_empty_array.py | 22 +- .../model/required_with_empty_array.pyi | 66 ++ .../model/required_with_escaped_characters.py | 32 +- .../required_with_escaped_characters.pyi | 81 +++ .../model/simple_enum_validation.py | 6 +- .../model/simple_enum_validation.pyi | 54 ++ .../model/string_type_matches_strings.py | 6 +- .../model/string_type_matches_strings.pyi | 23 + ..._do_anything_if_the_property_is_missing.py | 20 +- ...do_anything_if_the_property_is_missing.pyi | 70 +++ .../model/uniqueitems_false_validation.py | 14 +- .../model/uniqueitems_false_validation.pyi | 54 ++ .../model/uniqueitems_validation.py | 14 +- .../model/uniqueitems_validation.pyi | 54 ++ .../unit_test_api/model/uri_format.py | 6 +- .../unit_test_api/model/uri_format.pyi | 23 + .../model/uri_reference_format.py | 6 +- .../model/uri_reference_format.pyi | 23 + .../model/uri_template_format.py | 6 +- .../model/uri_template_format.pyi | 23 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 31 +- .../post.pyi | 91 +++ .../post.py | 17 +- .../post.pyi | 54 ++ .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 17 +- .../post.pyi | 60 ++ .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 35 +- .../post.pyi | 80 +++ .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 3 +- .../post.pyi | 29 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 9 +- .../post.pyi | 27 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 25 +- .../post.pyi | 90 +++ .../post.py | 11 +- .../post.pyi | 53 ++ .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 11 +- .../post.pyi | 59 ++ .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 29 +- .../post.pyi | 79 +++ .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../post.py | 3 +- .../post.pyi | 26 + .../unit_test_api/schemas.py | 115 ++-- .../.openapi-generator/FILES | 111 ++++ .../petstore_api/api_client.py | 22 +- .../model/additional_properties_class.py | 92 ++- .../model/additional_properties_class.pyi | 240 ++++++++ ...ditional_properties_with_array_of_enums.py | 14 +- ...itional_properties_with_array_of_enums.pyi | 81 +++ .../petstore_api/model/address.py | 12 +- .../petstore_api/model/address.pyi | 53 ++ .../petstore_api/model/animal.py | 24 +- .../petstore_api/model/animal.pyi | 89 +++ .../petstore_api/model/animal_farm.py | 8 +- .../petstore_api/model/animal_farm.pyi | 56 ++ .../petstore_api/model/any_type_not_string.py | 14 +- .../model/any_type_not_string.pyi | 55 ++ .../petstore_api/model/api_response.py | 28 +- .../petstore_api/model/api_response.pyi | 81 +++ .../petstore_api/model/apple.py | 26 +- .../petstore_api/model/apple.pyi | 88 +++ .../petstore_api/model/apple_req.py | 20 +- .../petstore_api/model/apple_req.pyi | 72 +++ .../model/array_holding_any_type.py | 10 +- .../model/array_holding_any_type.pyi | 50 ++ .../model/array_of_array_of_number_only.py | 24 +- .../model/array_of_array_of_number_only.pyi | 109 ++++ .../petstore_api/model/array_of_enums.py | 8 +- .../petstore_api/model/array_of_enums.pyi | 56 ++ .../model/array_of_number_only.py | 22 +- .../model/array_of_number_only.pyi | 87 +++ .../petstore_api/model/array_test.py | 38 +- .../petstore_api/model/array_test.pyi | 197 ++++++ .../model/array_with_validations_in_items.py | 8 +- .../model/array_with_validations_in_items.pyi | 55 ++ .../petstore_api/model/banana.py | 20 +- .../petstore_api/model/banana.pyi | 68 +++ .../petstore_api/model/banana_req.py | 20 +- .../petstore_api/model/banana_req.pyi | 72 +++ .../petstore_api/model/bar.py | 6 +- .../petstore_api/model/bar.pyi | 23 + .../petstore_api/model/basque_pig.py | 20 +- .../petstore_api/model/basque_pig.pyi | 82 +++ .../petstore_api/model/boolean.py | 6 +- .../petstore_api/model/boolean.pyi | 23 + .../petstore_api/model/boolean_enum.py | 6 +- .../petstore_api/model/boolean_enum.pyi | 42 ++ .../petstore_api/model/capitalization.py | 40 +- .../petstore_api/model/capitalization.pyi | 105 ++++ .../petstore_api/model/cat.py | 28 +- .../petstore_api/model/cat.pyi | 110 ++++ .../petstore_api/model/category.py | 26 +- .../petstore_api/model/category.pyi | 76 +++ .../petstore_api/model/child_cat.py | 28 +- .../petstore_api/model/child_cat.pyi | 110 ++++ .../petstore_api/model/class_model.py | 20 +- .../petstore_api/model/class_model.pyi | 68 +++ .../petstore_api/model/client.py | 20 +- .../petstore_api/model/client.pyi | 65 ++ .../model/complex_quadrilateral.py | 28 +- .../model/complex_quadrilateral.pyi | 124 ++++ ...d_any_of_different_types_no_validations.py | 18 +- ..._any_of_different_types_no_validations.pyi | 122 ++++ .../petstore_api/model/composed_array.py | 10 +- .../petstore_api/model/composed_array.pyi | 50 ++ .../petstore_api/model/composed_bool.py | 6 +- .../petstore_api/model/composed_bool.pyi | 64 ++ .../petstore_api/model/composed_none.py | 6 +- .../petstore_api/model/composed_none.pyi | 64 ++ .../petstore_api/model/composed_number.py | 6 +- .../petstore_api/model/composed_number.pyi | 64 ++ .../petstore_api/model/composed_object.py | 14 +- .../petstore_api/model/composed_object.pyi | 71 +++ .../model/composed_one_of_different_types.py | 26 +- .../model/composed_one_of_different_types.pyi | 137 +++++ .../petstore_api/model/composed_string.py | 6 +- .../petstore_api/model/composed_string.pyi | 64 ++ .../petstore_api/model/currency.py | 6 +- .../petstore_api/model/currency.pyi | 48 ++ .../petstore_api/model/danish_pig.py | 20 +- .../petstore_api/model/danish_pig.pyi | 82 +++ .../petstore_api/model/date_time_test.py | 6 +- .../petstore_api/model/date_time_test.pyi | 23 + .../model/date_time_with_validations.py | 6 +- .../model/date_time_with_validations.pyi | 33 + .../model/date_with_validations.py | 6 +- .../model/date_with_validations.pyi | 33 + .../petstore_api/model/decimal_payload.py | 6 +- .../petstore_api/model/decimal_payload.pyi | 23 + .../petstore_api/model/dog.py | 28 +- .../petstore_api/model/dog.pyi | 110 ++++ .../petstore_api/model/drawing.py | 32 +- .../petstore_api/model/drawing.pyi | 136 +++++ .../petstore_api/model/enum_arrays.py | 26 +- .../petstore_api/model/enum_arrays.pyi | 135 +++++ .../petstore_api/model/enum_class.py | 6 +- .../petstore_api/model/enum_class.pyi | 66 ++ .../petstore_api/model/enum_test.py | 56 +- .../petstore_api/model/enum_test.pyi | 250 ++++++++ .../model/equilateral_triangle.py | 28 +- .../model/equilateral_triangle.pyi | 124 ++++ .../petstore_api/model/file.py | 20 +- .../petstore_api/model/file.pyi | 67 +++ .../model/file_schema_test_class.py | 26 +- .../model/file_schema_test_class.pyi | 105 ++++ .../petstore_api/model/foo.py | 20 +- .../petstore_api/model/foo.pyi | 65 ++ .../petstore_api/model/format_test.py | 160 +++-- .../petstore_api/model/format_test.pyi | 295 +++++++++ .../petstore_api/model/fruit.py | 20 +- .../petstore_api/model/fruit.pyi | 85 +++ .../petstore_api/model/fruit_req.py | 14 +- .../petstore_api/model/fruit_req.pyi | 75 +++ .../petstore_api/model/gm_fruit.py | 20 +- .../petstore_api/model/gm_fruit.pyi | 85 +++ .../petstore_api/model/grandparent_animal.py | 20 +- .../petstore_api/model/grandparent_animal.pyi | 81 +++ .../petstore_api/model/has_only_read_only.py | 24 +- .../petstore_api/model/has_only_read_only.pyi | 73 +++ .../petstore_api/model/health_check_result.py | 20 +- .../model/health_check_result.pyi | 86 +++ .../petstore_api/model/integer_enum.py | 6 +- .../petstore_api/model/integer_enum.pyi | 54 ++ .../petstore_api/model/integer_enum_big.py | 6 +- .../petstore_api/model/integer_enum_big.pyi | 54 ++ .../model/integer_enum_one_value.py | 6 +- .../model/integer_enum_one_value.pyi | 42 ++ .../model/integer_enum_with_default_value.py | 6 +- .../model/integer_enum_with_default_value.pyi | 54 ++ .../petstore_api/model/integer_max10.py | 6 +- .../petstore_api/model/integer_max10.pyi | 33 + .../petstore_api/model/integer_min15.py | 6 +- .../petstore_api/model/integer_min15.pyi | 33 + .../petstore_api/model/isosceles_triangle.py | 28 +- .../petstore_api/model/isosceles_triangle.pyi | 124 ++++ .../petstore_api/model/mammal.py | 14 +- .../petstore_api/model/mammal.pyi | 86 +++ .../petstore_api/model/map_test.py | 64 +- .../petstore_api/model/map_test.pyi | 215 +++++++ ...perties_and_additional_properties_class.py | 36 +- ...erties_and_additional_properties_class.pyi | 112 ++++ .../petstore_api/model/model200_response.py | 36 +- .../petstore_api/model/model200_response.pyi | 73 +++ .../petstore_api/model/model_return.py | 32 +- .../petstore_api/model/model_return.pyi | 65 ++ .../petstore_api/model/money.py | 24 +- .../petstore_api/model/money.pyi | 83 +++ .../petstore_api/model/name.py | 40 +- .../petstore_api/model/name.pyi | 84 +++ .../model/no_additional_properties.py | 20 +- .../model/no_additional_properties.pyi | 72 +++ .../petstore_api/model/nullable_class.py | 152 +++-- .../petstore_api/model/nullable_class.pyi | 563 ++++++++++++++++++ .../petstore_api/model/nullable_shape.py | 14 +- .../petstore_api/model/nullable_shape.pyi | 77 +++ .../petstore_api/model/nullable_string.py | 6 +- .../petstore_api/model/nullable_string.pyi | 47 ++ .../petstore_api/model/number.py | 6 +- .../petstore_api/model/number.pyi | 23 + .../petstore_api/model/number_only.py | 20 +- .../petstore_api/model/number_only.pyi | 65 ++ .../model/number_with_validations.py | 6 +- .../model/number_with_validations.pyi | 33 + .../petstore_api/model/object_interface.py | 6 +- .../petstore_api/model/object_interface.pyi | 23 + .../model/object_model_with_ref_props.py | 28 +- .../model/object_model_with_ref_props.pyi | 89 +++ .../model/object_with_decimal_properties.py | 28 +- .../model/object_with_decimal_properties.pyi | 87 +++ .../object_with_difficultly_named_props.py | 66 +- .../object_with_difficultly_named_props.pyi | 77 +++ ...object_with_inline_composition_property.py | 30 +- ...bject_with_inline_composition_property.pyi | 112 ++++ .../model/object_with_validations.py | 14 +- .../model/object_with_validations.pyi | 53 ++ .../petstore_api/model/order.py | 40 +- .../petstore_api/model/order.pyi | 131 ++++ .../petstore_api/model/parent_pet.py | 14 +- .../petstore_api/model/parent_pet.pyi | 82 +++ .../petstore_api/model/pet.py | 56 +- .../petstore_api/model/pet.pyi | 192 ++++++ .../petstore_api/model/pig.py | 14 +- .../petstore_api/model/pig.pyi | 83 +++ .../petstore_api/model/player.py | 24 +- .../petstore_api/model/player.pyi | 79 +++ .../petstore_api/model/quadrilateral.py | 14 +- .../petstore_api/model/quadrilateral.pyi | 83 +++ .../model/quadrilateral_interface.py | 24 +- .../model/quadrilateral_interface.pyi | 92 +++ .../petstore_api/model/read_only_first.py | 24 +- .../petstore_api/model/read_only_first.pyi | 73 +++ .../petstore_api/model/scalene_triangle.py | 28 +- .../petstore_api/model/scalene_triangle.pyi | 124 ++++ .../petstore_api/model/shape.py | 14 +- .../petstore_api/model/shape.pyi | 83 +++ .../petstore_api/model/shape_or_null.py | 14 +- .../petstore_api/model/shape_or_null.pyi | 87 +++ .../model/simple_quadrilateral.py | 28 +- .../model/simple_quadrilateral.pyi | 124 ++++ .../petstore_api/model/some_object.py | 14 +- .../petstore_api/model/some_object.pyi | 71 +++ .../petstore_api/model/special_model_name.py | 20 +- .../petstore_api/model/special_model_name.pyi | 67 +++ .../petstore_api/model/string.py | 6 +- .../petstore_api/model/string.pyi | 23 + .../petstore_api/model/string_boolean_map.py | 12 +- .../petstore_api/model/string_boolean_map.pyi | 53 ++ .../petstore_api/model/string_enum.py | 6 +- .../petstore_api/model/string_enum.pyi | 93 +++ .../model/string_enum_with_default_value.py | 6 +- .../model/string_enum_with_default_value.pyi | 54 ++ .../model/string_with_validation.py | 6 +- .../model/string_with_validation.pyi | 33 + .../petstore_api/model/tag.py | 24 +- .../petstore_api/model/tag.pyi | 73 +++ .../petstore_api/model/triangle.py | 14 +- .../petstore_api/model/triangle.pyi | 86 +++ .../petstore_api/model/triangle_interface.py | 24 +- .../petstore_api/model/triangle_interface.pyi | 92 +++ .../petstore_api/model/user.py | 96 ++- .../petstore_api/model/user.pyi | 217 +++++++ .../petstore_api/model/uuid_string.py | 6 +- .../petstore_api/model/uuid_string.pyi | 33 + .../petstore_api/model/whale.py | 32 +- .../petstore_api/model/whale.pyi | 98 +++ .../petstore_api/model/zebra.py | 54 +- .../petstore_api/model/zebra.pyi | 116 ++++ .../paths/another_fake_dummy/patch.py | 3 +- .../paths/another_fake_dummy/patch.pyi | 30 + .../petstore_api/paths/fake/patch.py | 3 +- .../petstore_api/paths/fake/patch.pyi | 30 + .../petstore_api/paths/fake_1/post.py | 87 ++- .../petstore_api/paths/fake_1/post.pyi | 211 +++++++ .../petstore_api/paths/fake_2/get.py | 45 +- .../petstore_api/paths/fake_2/get.pyi | 324 ++++++++++ .../petstore_api/paths/fake_3/delete.py | 15 +- .../petstore_api/paths/fake_3/delete.pyi | 33 + .../get.py | 3 +- .../get.pyi | 30 + .../paths/fake_body_with_file_schema/put.py | 3 +- .../paths/fake_body_with_file_schema/put.pyi | 29 + .../paths/fake_body_with_query_params/put.py | 9 +- .../paths/fake_body_with_query_params/put.pyi | 31 + .../paths/fake_case_sensitive_params/put.py | 9 +- .../paths/fake_case_sensitive_params/put.pyi | 28 + .../paths/fake_classname_test/patch.py | 3 +- .../paths/fake_classname_test/patch.pyi | 30 + .../paths/fake_delete_coffee_id/delete.py | 9 +- .../paths/fake_delete_coffee_id/delete.pyi | 26 + .../petstore_api/paths/fake_health/get.py | 3 +- .../petstore_api/paths/fake_health/get.pyi | 28 + .../fake_inline_additional_properties/post.py | 15 +- .../post.pyi | 52 ++ .../paths/fake_inline_composition_/post.py | 115 +++- .../paths/fake_inline_composition_/post.pyi | 426 +++++++++++++ .../paths/fake_json_form_data/get.py | 27 +- .../paths/fake_json_form_data/get.pyi | 76 +++ .../paths/fake_json_with_charset/post.py | 9 +- .../paths/fake_json_with_charset/post.pyi | 28 + .../paths/fake_obj_in_query/get.py | 25 +- .../paths/fake_obj_in_query/get.pyi | 63 ++ .../post.py | 33 +- .../post.pyi | 51 ++ .../post.py | 33 +- .../post.pyi | 80 +++ .../paths/fake_ref_obj_in_query/get.py | 9 +- .../paths/fake_ref_obj_in_query/get.pyi | 28 + .../paths/fake_refs_array_of_enums/post.py | 3 +- .../paths/fake_refs_array_of_enums/post.pyi | 30 + .../paths/fake_refs_arraymodel/post.py | 3 +- .../paths/fake_refs_arraymodel/post.pyi | 30 + .../paths/fake_refs_boolean/post.py | 3 +- .../paths/fake_refs_boolean/post.pyi | 28 + .../post.py | 3 +- .../post.pyi | 30 + .../petstore_api/paths/fake_refs_enum/post.py | 3 +- .../paths/fake_refs_enum/post.pyi | 30 + .../paths/fake_refs_mammal/post.py | 3 +- .../paths/fake_refs_mammal/post.pyi | 30 + .../paths/fake_refs_number/post.py | 3 +- .../paths/fake_refs_number/post.pyi | 30 + .../post.py | 3 +- .../post.pyi | 30 + .../paths/fake_refs_string/post.py | 3 +- .../paths/fake_refs_string/post.pyi | 28 + .../paths/fake_response_without_schema/get.py | 3 +- .../fake_response_without_schema/get.pyi | 25 + .../paths/fake_test_query_paramters/put.py | 19 +- .../paths/fake_test_query_paramters/put.pyi | 143 +++++ .../paths/fake_upload_download_file/post.py | 3 +- .../paths/fake_upload_download_file/post.pyi | 28 + .../paths/fake_upload_file/post.py | 27 +- .../paths/fake_upload_file/post.pyi | 78 +++ .../paths/fake_upload_files/post.py | 25 +- .../paths/fake_upload_files/post.pyi | 89 +++ .../petstore_api/paths/foo/get.py | 17 +- .../petstore_api/paths/foo/get.pyi | 69 +++ .../petstore_api/paths/pet/post.py | 3 +- .../petstore_api/paths/pet/post.pyi | 30 + .../petstore_api/paths/pet_2/put.py | 3 +- .../petstore_api/paths/pet_2/put.pyi | 30 + .../paths/pet_find_by_status/get.py | 15 +- .../paths/pet_find_by_status/get.pyi | 131 ++++ .../paths/pet_find_by_tags/get.py | 15 +- .../paths/pet_find_by_tags/get.pyi | 105 ++++ .../petstore_api/paths/pet_pet_id/delete.py | 15 +- .../petstore_api/paths/pet_pet_id/delete.pyi | 29 + .../petstore_api/paths/pet_pet_id_1/get.py | 9 +- .../petstore_api/paths/pet_pet_id_1/get.pyi | 31 + .../petstore_api/paths/pet_pet_id_3/post.py | 33 +- .../petstore_api/paths/pet_pet_id_3/post.pyi | 74 +++ .../paths/pet_pet_id_upload_image/post.py | 33 +- .../paths/pet_pet_id_upload_image/post.pyi | 77 +++ .../petstore_api/paths/store_inventory/get.py | 9 +- .../paths/store_inventory/get.pyi | 51 ++ .../petstore_api/paths/store_order/post.py | 3 +- .../petstore_api/paths/store_order/post.pyi | 31 + .../paths/store_order_order_id/delete.py | 9 +- .../paths/store_order_order_id/delete.pyi | 26 + .../paths/store_order_order_id_1/get.py | 9 +- .../paths/store_order_order_id_1/get.pyi | 36 ++ .../petstore_api/paths/user/post.py | 3 +- .../petstore_api/paths/user/post.pyi | 29 + .../paths/user_create_with_array/post.py | 5 +- .../paths/user_create_with_array/post.pyi | 55 ++ .../paths/user_create_with_list/post.py | 5 +- .../paths/user_create_with_list/post.pyi | 55 ++ .../petstore_api/paths/user_login/get.py | 9 +- .../petstore_api/paths/user_login/get.pyi | 32 + .../petstore_api/paths/user_logout/get.py | 3 +- .../petstore_api/paths/user_logout/get.pyi | 24 + .../paths/user_username/delete.py | 9 +- .../paths/user_username/delete.pyi | 26 + .../petstore_api/paths/user_username_1/get.py | 9 +- .../paths/user_username_1/get.pyi | 31 + .../petstore_api/paths/user_username_2/put.py | 9 +- .../paths/user_username_2/put.pyi | 31 + .../petstore_api/schemas.py | 115 ++-- .../tests_manual/test_animal.py | 12 +- .../tests_manual/test_any_type_schema.py | 7 +- .../test_composed_one_of_different_types.py | 10 +- .../tests_manual/test_format_test.py | 6 +- .../tests_manual/test_gm_fruit.py | 7 +- .../test_object_model_with_ref_props.py | 9 +- .../tests_manual/test_shape.py | 7 +- .../tests_manual/test_triangle.py | 5 +- .../tests_manual/test_validate.py | 37 +- 893 files changed, 28509 insertions(+), 2276 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi create mode 100644 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.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.pyi create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.pyi diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index d5dee91e86c..0ca4e4e5eb5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -110,6 +110,8 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { loadDeepObjectIntoItems = false; importBaseType = false; addSchemaImportsFromV3SpecLocations = true; + sortModelPropertiesByRequiredFlag = Boolean.TRUE; + sortParamsByRequiredFlag = Boolean.TRUE; modifyFeatureSet(features -> features .includeSchemaSupportFeatures( @@ -280,6 +282,12 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { } modelTemplateFiles.put("model." + templateExtension, ".py"); + /* + This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that + dict_instance["someProp"] is of type SomeClass.properties.someProp + See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator + */ + modelTemplateFiles.put("model_stub." + templateExtension, ".pyi"); apiTemplateFiles.put("api." + templateExtension, ".py"); modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); modelDocTemplateFiles.put("model_doc." + templateExtension, ".md"); @@ -552,6 +560,13 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { endpointMap.put("packageName", packageName); outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".py")); pathsFiles.add(Arrays.asList(endpointMap, "endpoint.handlebars", outputFilename)); + /* + This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that + dict_instance["someProp"] is of type SomeClass.properties.someProp + See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator + */ + String stubOutputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".pyi")); + pathsFiles.add(Arrays.asList(endpointMap, "endpoint_stub.handlebars", stubOutputFilename)); Map endpointTestMap = new HashMap<>(); endpointTestMap.put("operation", co); @@ -996,7 +1011,9 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { */ @Override public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) { - CodegenProperty cp = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties); + // fix needed for values with /n /t etc in them + String fixedName = handleSpecialCharacters(name); + CodegenProperty cp = super.fromProperty(fixedName, p, required, schemaIsFromAdditionalProperties); if (cp.isAnyType && cp.isNullable) { cp.isNullable = false; @@ -1013,9 +1030,8 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { // set cp.nameInSnakeCase to a value so we can tell that we are in this use case // we handle this in the schema templates // templates use its presence to handle these badly named variables / keys - if ((isReservedWord(name) || !isValidPythonVarOrClassName(name)) && !name.equals(cp.name)) { + if ((isReservedWord(cp.baseName) || !isValidPythonVarOrClassName(cp.baseName)) && !cp.baseName.equals(cp.name)) { cp.nameInSnakeCase = cp.name; - cp.baseName = (String) processTestExampleData(name); } else { cp.nameInSnakeCase = null; } 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 6ac38c906a3..0eaa6543df0 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 @@ -21,6 +21,7 @@ from urllib3.fields import RequestField as RequestFieldBase {{#if tornado}} import tornado.gen {{/if}} +import frozendict from {{packageName}} import rest from {{packageName}}.configuration import Configuration @@ -34,7 +35,6 @@ from {{packageName}}.schemas import ( date, datetime, none_type, - frozendict, Unset, unset, ) @@ -63,7 +63,7 @@ class JSONEncoder(json.JSONEncoder): return None elif isinstance(obj, BoolClass): return bool(obj) - elif isinstance(obj, (dict, frozendict)): + elif isinstance(obj, (dict, frozendict.frozendict)): return {key: self.default(val) for key, val in obj.items()} elif isinstance(obj, (list, tuple)): return [self.default(item) for item in obj] @@ -474,7 +474,7 @@ class PathParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -592,7 +592,7 @@ class QueryParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: if self.schema: @@ -658,7 +658,7 @@ class CookieParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -730,7 +730,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -1369,8 +1369,8 @@ class RequestBody(StyleFormSerializer, JSONDetector): @staticmethod def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict): - raise ValueError('Unable to serialize type frozendict to text/plain') + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') elif isinstance(in_data, tuple): raise ValueError('Unable to serialize type tuple to text/plain') elif isinstance(in_data, NoneClass): @@ -1403,7 +1403,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): def __serialize_multipart_form_data( self, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') """ In a multipart/form-data request body, each schema property, or each element of a schema array property, @@ -1450,7 +1450,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): """ POST submission of form data in body """ - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) @@ -1472,7 +1472,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): media_type = self.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict)) and in_data: + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: cast_in_data = media_type.schema(**in_data) else: cast_in_data = media_type.schema(in_data) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars index 8129114a5b7..b04051912f2 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars @@ -18,8 +18,10 @@ from {{packageName}} import api_client, exceptions {{> model_templates/imports_schema_types }} {{> model_templates/imports_schemas }} +{{#unless isStub}} from . import path +{{/unless}} {{#with operation}} {{#if queryParams}} # query params @@ -28,6 +30,7 @@ from . import path {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} RequestRequiredQueryParams = typing.TypedDict( 'RequestRequiredQueryParams', { @@ -58,6 +61,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) {{#each queryParams}} {{> endpoint_parameter }} {{/each}} +{{/unless}} {{/if}} {{#if headerParams}} # header params @@ -66,6 +70,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} RequestRequiredHeaderParams = typing.TypedDict( 'RequestRequiredHeaderParams', { @@ -96,6 +101,7 @@ class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderPara {{#each headerParams}} {{> endpoint_parameter }} {{/each}} +{{/unless}} {{/if}} {{#if pathParams}} # path params @@ -104,6 +110,7 @@ class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderPara {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} RequestRequiredPathParams = typing.TypedDict( 'RequestRequiredPathParams', { @@ -134,6 +141,7 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): {{#each pathParams}} {{> endpoint_parameter }} {{/each}} +{{/unless}} {{/if}} {{#if cookieParams}} # cookie params @@ -142,6 +150,7 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} RequestRequiredCookieParams = typing.TypedDict( 'RequestRequiredCookieParams', { @@ -172,6 +181,7 @@ class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookiePara {{#each cookieParams}} {{> endpoint_parameter }} {{/each}} +{{/unless}} {{/if}} {{#with bodyParam}} # body param @@ -180,6 +190,7 @@ class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookiePara {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} request_body_{{paramName}} = api_client.RequestBody( @@ -193,7 +204,9 @@ request_body_{{paramName}} = api_client.RequestBody( required=True, {{/if}} ) +{{/unless}} {{/with}} +{{#unless isStub}} {{#each authMethods}} {{#if @first}} _auth = [ @@ -236,11 +249,13 @@ _servers = ( ) {{/if}} {{/each}} +{{/unless}} {{#each responses}} {{#each responseHeaders}} {{#with schema}} {{> model_templates/schema }} {{/with}} +{{#unless isStub}} {{paramName}}_parameter = api_client.HeaderParameter( name="{{baseName}}", {{#if style}} @@ -258,12 +273,14 @@ _servers = ( explode=True, {{/if}} ) +{{/unless}} {{/each}} {{#each content}} {{#with this.schema}} {{> model_templates/schema }} {{/with}} {{/each}} +{{#unless isStub}} {{#if responseHeaders}} ResponseHeadersFor{{code}} = typing.TypedDict( 'ResponseHeadersFor{{code}}', @@ -346,7 +363,9 @@ _response_for_{{code}} = api_client.OpenApiResponse( ] {{/if}} ) +{{/unless}} {{/each}} +{{#unless isStub}} _status_code_to_response = { {{#each responses}} {{#if isDefault}} @@ -533,4 +552,5 @@ class ApiFor{{httpMethod}}(BaseApi): ) +{{/unless}} {{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars index d45dda2496c..01aa9ddbce7 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars @@ -5,16 +5,16 @@ {{/with}} {{/if}} {{#if queryParams}} - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), {{/if}} {{#if headerParams}} - header_params: RequestHeaderParams = frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), {{/if}} {{#if pathParams}} - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), {{/if}} {{#if cookieParams}} - cookie_params: RequestCookieParams = frozendict(), + cookie_params: RequestCookieParams = frozendict.frozendict(), {{/if}} {{#with bodyParam}} {{#each content}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars new file mode 100644 index 00000000000..b84c7698d36 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars @@ -0,0 +1 @@ +{{> endpoint isStub=true }} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars index 03f72a86b82..50b24074f9f 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars @@ -3,12 +3,9 @@ {{>partial_header}} import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - {{#each models}} {{#with model}} {{> model_templates/imports_schema_types }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars new file mode 100644 index 00000000000..50700cf72d0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars @@ -0,0 +1 @@ +{{> model isStub=true }} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars index 44c845944a0..7e8b8795594 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars @@ -37,6 +37,15 @@ class properties: {{> model_templates/schema }} {{/if}} {{/each}} + __annotations__ = { +{{#each vars}} +{{#if nameInSnakeCase}} + "{{{baseName}}}": {{name}}, +{{else}} + "{{{baseName}}}": {{baseName}}, +{{/if}} +{{/each}} + } {{/if}} {{#with additionalProperties}} {{#if complexType}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars index b016fdf81d7..21c11213cb6 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars @@ -1,6 +1,7 @@ import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from {{packageName}} import schemas # noqa: F401 diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars new file mode 100644 index 00000000000..38d094d5613 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars @@ -0,0 +1,42 @@ +{{#if getRequiredVarsMap}} +{{#each getRequiredVarsMap}} +{{#with this}} + +@typing.overload +{{#if complexType}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... +{{else}} +{{#if schemaIsFromAdditionalProperties}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ... +{{else}} +{{#if nameInSnakeCase}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... +{{else}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... +{{/if}} +{{/if}} +{{/if}} +{{/with}} +{{/each}} +{{/if}} +{{#if vars}} +{{#each vars}} +{{#unless required}} + +@typing.overload +{{#if complexType}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... +{{else}} +{{#if nameInSnakeCase}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... +{{else}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... +{{/if}} +{{/if}} +{{/unless}} +{{/each}} +{{/if}} + +def __getitem__(self, name: str) -> {{#with additionalProperties}}{{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}{{/with}}: + # dict_instance[name] accessor + return super().__getitem__(name) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars new file mode 100644 index 00000000000..b135b9d1fb9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars @@ -0,0 +1,30 @@ +{{#if vars}} +{{#each vars}} + +{{#unless @last}} +@typing.overload +{{#if complexType}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ... +{{else}} +{{#if nameInSnakeCase}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ... +{{else}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ... +{{/if}} +{{/if}} +{{else}} +{{#if complexType}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': +{{else}} +{{#if nameInSnakeCase}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: +{{else}} +def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: +{{/if}} +{{/if}} + # dict_instance[name] accessor + return super().__getitem__(name) +{{/unless}} +{{/each}} + +{{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars index 04e3ece4734..d55c5c36912 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars @@ -30,4 +30,9 @@ {{/unless}} {{/unless}} {{/each}} +{{/if}} +{{#if additionalProperties}} +{{> model_templates/property_getitems_with_addprops }} +{{else}} +{{> model_templates/property_getitems_without_addprops }} {{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars index 0edbaf61891..41c7346762b 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars @@ -38,19 +38,5 @@ {{> model_templates/var_equals_cls }} {{/or}} {{/or}} - {{#if nameInSnakeCase}} -locals()["{{{baseName}}}"] = {{name}} -del locals()['{{name}}'] -""" -NOTE: -openapi/json-schema allows properties to have invalid python names -The above local assignment allows the code to keep those invalid python names -This allows properties to have names like 'some-name', '1 bad name' -Properties with these names are omitted from the __new__ + _from_openapi_data signatures -- __new__ these properties can be passed in as **kwargs -- _from_openapi_data these are passed in in a dict in the first positional argument *arg -If the property is required and was not passed in, an exception will be thrown -""" - {{/if}} {{/if}} {{/unless}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars index d258f065887..694a09fc70f 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars @@ -9,7 +9,7 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{/if}} {{else}} {{#if getHasMultipleTypes}} - schemas.SchemaTypeCheckerClsFactory(typing.Union[{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict, {{/if}}{{#if isNull}}schemas.NoneClass, {{/if}}{{#if isString}}str, {{/if}}{{#if isByteArray}}str, {{/if}}{{#if isUnboundedInteger}}decimal.Decimal, {{/if}}{{#if isShort}}decimal.Decimal, {{/if}}{{#if isLong}}decimal.Decimal, {{/if}}{{#if isFloat}}decimal.Decimal, {{/if}}{{#if isDouble}}decimal.Decimal, {{/if}}{{#if isNumber}}decimal.Decimal, {{/if}}{{#if isDate}}str, {{/if}}{{#if isDateTime}}str, {{/if}}{{#if isDecimal}}str, {{/if}}{{#if isBoolean}}schemas.BoolClass, {{/if}}]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict.frozendict, {{/if}}{{#if isNull}}schemas.NoneClass, {{/if}}{{#or isUnboundedInteger isShort isLong isFloat isDouble isNumber}}decimal.Decimal, {{/or}}{{#or isString isByteArray isDate isDateTime isDecimal}}str, {{/or}}{{#if isBoolean}}schemas.BoolClass, {{/if}}]), {{/if}} {{#if composedSchemas}} schemas.ComposedBase, @@ -49,9 +49,11 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{#or isMap isAnyType}} {{> model_templates/dict_partial }} {{/or}} +{{#unless isStub}} {{#if hasValidation}} {{> model_templates/validations }} {{/if}} +{{/unless}} {{#if composedSchemas}} {{> model_templates/composed_schemas }} {{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars index 6338ebbc1c2..46073d372da 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars @@ -1,6 +1,6 @@ -class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( +class {{> model_templates/classname }}( schemas.DictSchema ): {{#if this.classname}} @@ -18,7 +18,9 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} class MetaOapg: {{> model_templates/dict_partial }} +{{#unless isStub}} {{> model_templates/validations }} +{{/unless}} {{> model_templates/property_type_hints }} {{> model_templates/new }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars index c44b729022e..2b6c045814c 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars @@ -17,7 +17,9 @@ class {{> model_templates/classname }}( class MetaOapg: +{{#unless isStub}} {{> model_templates/validations }} +{{/unless}} {{#with items}} {{#if complexType}} @@ -32,5 +34,5 @@ class {{> model_templates/classname }}( {{> model_templates/new }} - def __getitem__(self, i) -> {{#with items}}{{#if complexType}}'{{baseName}}'{{else}}MetaOapg.items{{/if}}{{/with}}: + def __getitem__(self, i: int) -> {{#with items}}{{#if complexType}}'{{complexType}}'{{else}}MetaOapg.items{{/if}}{{/with}}: return super().__getitem__(i) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars index 84c0c38d68c..bdc9870d77f 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars @@ -1 +1 @@ -{{#if isAnyType}}dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, {{/if}}{{#if isArray}}tuple, {{/if}}{{#if isMap}}dict, frozendict, {{/if}}{{#if isNull}}None, {{/if}}{{#or isString isByteArray}}str, {{/or}}{{#or isUnboundedInteger isShort isLong}}int, {{/or}}{{#or isFloat isDouble}}float, {{/or}}{{#if isNumber}}decimal.Decimal, int, float, {{/if}}{{#if isDate}}date, str, {{/if}}{{#if isUuid}}uuid.UUID, str, {{/if}}{{#if isDateTime}}datetime, str, {{/if}}{{#if isDecimal}}str, {{/if}}{{#if isBoolean}}bool, {{/if}} \ No newline at end of file +{{#if isAnyType}}dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, {{/if}}{{#if isArray}}tuple, {{/if}}{{#if isMap}}dict, frozendict.frozendict, {{/if}}{{#if isNull}}None, {{/if}}{{#or isString isByteArray}}str, {{/or}}{{#or isUnboundedInteger isShort isLong}}int, {{/or}}{{#or isFloat isDouble}}float, {{/or}}{{#if isNumber}}decimal.Decimal, int, float, {{/if}}{{#if isDate}}date, str, {{/if}}{{#if isUuid}}uuid.UUID, str, {{/if}}{{#if isDateTime}}datetime, str, {{/if}}{{#if isDecimal}}str, {{/if}}{{#if isBoolean}}bool, {{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars index e06a6679b4a..b5e7ee24269 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars @@ -17,12 +17,21 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{/if}} """ {{/if}} +{{#unless isStub}} {{#if hasValidation}} class MetaOapg: {{> model_templates/validations }} {{/if}} +{{/unless}} {{#if isEnum}} {{> model_templates/enums }} +{{/if}} +{{#if isStub}} +{{#if hasValidation}} +{{#unless isEnum}} + pass +{{/unless}} +{{/if}} {{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars index 38e09c2306c..6fb35e845a4 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#each getRequiredVarsMap}} -**{{{@key}}}** | {{#with this}}{{#unless complexType}}**{{dataType}}**{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{#if isReadOnly}}[readonly] {{/if}}{{#if defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/if}}{{/with}} +**{{@key}}** | {{#with this}}{{#unless complexType}}**{{dataType}}**{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{#if isReadOnly}}[readonly] {{/if}}{{#if defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/if}}{{/with}} {{/each}} {{#each vars}} {{#unless required}} 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 1475d68ba30..68c4a74f863 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -12,7 +12,7 @@ import typing import uuid from dateutil.parser.isoparser import isoparser, _takes_ascii -from frozendict import frozendict +import frozendict from {{packageName}}.exceptions import ( ApiTypeError, @@ -72,7 +72,7 @@ def update(d: dict, u: dict): d[k] = d[k] | v -class ValidationMetadata(frozendict): +class ValidationMetadata(frozendict.frozendict): """ A class storing metadata that is needed to validate OpenApi Schema payloads """ @@ -82,7 +82,7 @@ class ValidationMetadata(frozendict): from_server: bool = False, configuration: typing.Optional[Configuration] = None, seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict() + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() ): """ Args: @@ -237,7 +237,7 @@ class Schema: """ the base class of all swagger/openapi schemas/models """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict, FileIO, bytes, BoolClass, NoneClass} + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} MetaOapg = MetaOapgTyped @classmethod @@ -245,7 +245,7 @@ class Schema: cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ Schema _validate Runs all schema validation logic and @@ -256,7 +256,7 @@ class Schema: - the returned instance is a serializable type (except for None, True, and False) which are enums Use cases: - 1. inheritable type: string/decimal.Decimal/frozendict/tuple + 1. inheritable type: string/decimal.Decimal/frozendict.frozendict/tuple 2. singletons: bool/None -> uses the base classes BoolClass/NoneClass Required Steps: @@ -279,7 +279,7 @@ class Schema: @staticmethod def __process_schema_classes( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]] + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] ): """ Processes and mutates schema_classes @@ -332,11 +332,11 @@ class Schema: for path, schema_classes in _path_to_schemas.items(): """ Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict/str/Decimal/bytes/FileIo + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo needs Singleton added 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict/str/Decimal/bytes/FileIo + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo """ cls.__process_schema_classes(schema_classes) enum_schema = any( @@ -361,7 +361,7 @@ class Schema: path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict): + if issubclass(cls, frozendict.frozendict): properties = cls._get_properties(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, properties) elif issubclass(cls, tuple): @@ -389,7 +389,7 @@ class Schema: None, 'Schema', dict, - frozendict, + frozendict.frozendict, tuple, list, io.FileIO, @@ -416,25 +416,25 @@ class Schema: return new_inst @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict: + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: input_dict = {} - if args and isinstance(args[0], (dict, frozendict)): + if args and isinstance(args[0], (dict, frozendict.frozendict)): input_dict.update(args[0]) if kwargs: input_dict.update(kwargs) - return frozendict(input_dict) + return frozendict.frozendict(input_dict) @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: - args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values _configuration: contains the Configuration that enables json schema validation keywords like minItems, minLength etc """ @@ -464,10 +464,10 @@ class Schema: def __init__( self, *args: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] ): """ @@ -531,7 +531,7 @@ class Validator(typing.Protocol): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: pass @@ -603,7 +603,7 @@ def SchemaTypeCheckerClsFactory(union_type_cls: typing.Union[typing.Any]) -> Val cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaTypeChecker _validate Validates arg's type @@ -654,7 +654,7 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaEnumMaker _validate Validates that arg is in the enum's allowed values @@ -777,7 +777,7 @@ class StrBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ StrBase _validate Validates that validations pass @@ -1061,7 +1061,7 @@ class NumberBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ NumberBase _validate Validates that validations pass @@ -1294,10 +1294,12 @@ class DictBase(Discriminable, ValidatorBase): invalid_arguments = [] required_property_names = getattr(cls.MetaOapg, 'required', set()) additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name in arg: if property_name in required_property_names: seen_required_properties.add(property_name) - elif property_name in cls._property_names: + elif property_name in property_annotations: continue elif additional_properties: continue @@ -1341,15 +1343,20 @@ class DictBase(Discriminable, ValidatorBase): """ path_to_schemas = {} additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name, value in arg.items(): - if property_name in cls._property_names: - schema = getattr(cls.MetaOapg.properties, property_name) + if property_name in property_annotations: + schema = property_annotations[property_name] elif additional_properties: schema = additional_properties else: raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( value, cls, validation_metadata.path_to_item+(property_name,) )) + if isinstance(schema, classmethod): + # referenced schema, call classmethod property + schema = schema.__func__.fget(properties) arg_validation_metadata = ValidationMetadata( from_server=validation_metadata.from_server, configuration=validation_metadata.configuration, @@ -1411,10 +1418,10 @@ class DictBase(Discriminable, ValidatorBase): ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if isinstance(arg, frozendict): + if isinstance(arg, frozendict.frozendict): cls.__check_dict_validations(arg, validation_metadata) _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict): + if not isinstance(arg, frozendict.frozendict): return _path_to_schemas cls._validate_arg_presence(arg) other_path_to_schemas = cls._validate_args(arg, validation_metadata=validation_metadata) @@ -1450,30 +1457,6 @@ class DictBase(Discriminable, ValidatorBase): update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas - @classmethod - @property - @functools.cache - def _property_names(cls) -> typing.Tuple[str]: - if not hasattr(cls.MetaOapg, 'properties'): - return tuple() - property_names = set() - for var_name, var_value in cls.MetaOapg.properties.__dict__.items(): - var_name: str - # referenced models are classmethods - is_classmethod = type(var_value) is classmethod - if is_classmethod: - property_names.add(var_name) - continue - is_class = type(var_value) is type - if not is_class: - continue - if not issubclass(var_value, Schema): - continue - property_names.add(var_name) - property_names = list(property_names) - property_names.sort() - return tuple(property_names) - @classmethod def _get_properties( cls, @@ -1518,7 +1501,7 @@ class DictBase(Discriminable, ValidatorBase): def __getattr__(self, name: str): # for instance.name access - if isinstance(self, frozendict): + if isinstance(self, frozendict.frozendict): # if an attribute does not exist try: return self[name] @@ -1528,11 +1511,11 @@ class DictBase(Discriminable, ValidatorBase): def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema], + arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema], from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]], + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: +) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: """ Casts the input payload arg into the allowed types The input validated_path_to_schemas is mutated by running this function @@ -1564,8 +1547,8 @@ def cast_to_allowed_types( if isinstance(arg, str): return str(arg) - elif isinstance(arg, (dict, frozendict)): - return frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) + elif isinstance(arg, (dict, frozendict.frozendict)): + return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) elif isinstance(arg, (bool, BoolClass)): """ this check must come before isinstance(arg, (int, float)) @@ -1687,7 +1670,7 @@ class ComposedBase(Discriminable): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ ComposedBase _validate We return dynamic classes of different bases depending upon the inputs @@ -1717,7 +1700,7 @@ class ComposedBase(Discriminable): # process composed schema discriminator = getattr(cls, 'discriminator', None) discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict): + if discriminator and arg and isinstance(arg, frozendict.frozendict): disc_property_name = list(discriminator.keys())[0] cls._ensure_discriminator_value_present(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class @@ -1781,7 +1764,7 @@ class ComposedBase(Discriminable): # DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase class ComposedSchema( - SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict.frozendict]), ComposedBase, DictBase, ListBase, @@ -2086,7 +2069,7 @@ class BoolSchema( class AnyTypeSchema( SchemaTypeCheckerClsFactory( - typing.Union[frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] + typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] ), DictBase, ListBase, @@ -2100,7 +2083,7 @@ class AnyTypeSchema( class DictSchema( - SchemaTypeCheckerClsFactory(typing.Union[frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict]), DictBase, Schema, FrozenDictMixin @@ -2109,11 +2092,11 @@ class DictSchema( def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *args, **kwargs) -schema_type_classes = set([NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema]) +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema} @functools.cache diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES index ccb99381aa8..76fb1cb914d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES @@ -245,91 +245,177 @@ unit_test_api/configuration.py unit_test_api/exceptions.py unit_test_api/model/__init__.py unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py +unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi unit_test_api/model/additionalproperties_are_allowed_by_default.py +unit_test_api/model/additionalproperties_are_allowed_by_default.pyi unit_test_api/model/additionalproperties_can_exist_by_itself.py +unit_test_api/model/additionalproperties_can_exist_by_itself.pyi unit_test_api/model/additionalproperties_should_not_look_in_applicators.py +unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi unit_test_api/model/allof.py +unit_test_api/model/allof.pyi unit_test_api/model/allof_combined_with_anyof_oneof.py +unit_test_api/model/allof_combined_with_anyof_oneof.pyi unit_test_api/model/allof_simple_types.py +unit_test_api/model/allof_simple_types.pyi unit_test_api/model/allof_with_base_schema.py +unit_test_api/model/allof_with_base_schema.pyi unit_test_api/model/allof_with_one_empty_schema.py +unit_test_api/model/allof_with_one_empty_schema.pyi unit_test_api/model/allof_with_the_first_empty_schema.py +unit_test_api/model/allof_with_the_first_empty_schema.pyi unit_test_api/model/allof_with_the_last_empty_schema.py +unit_test_api/model/allof_with_the_last_empty_schema.pyi unit_test_api/model/allof_with_two_empty_schemas.py +unit_test_api/model/allof_with_two_empty_schemas.pyi unit_test_api/model/anyof.py +unit_test_api/model/anyof.pyi unit_test_api/model/anyof_complex_types.py +unit_test_api/model/anyof_complex_types.pyi unit_test_api/model/anyof_with_base_schema.py +unit_test_api/model/anyof_with_base_schema.pyi unit_test_api/model/anyof_with_one_empty_schema.py +unit_test_api/model/anyof_with_one_empty_schema.pyi unit_test_api/model/array_type_matches_arrays.py +unit_test_api/model/array_type_matches_arrays.pyi unit_test_api/model/boolean_type_matches_booleans.py +unit_test_api/model/boolean_type_matches_booleans.pyi unit_test_api/model/by_int.py +unit_test_api/model/by_int.pyi unit_test_api/model/by_number.py +unit_test_api/model/by_number.pyi unit_test_api/model/by_small_number.py +unit_test_api/model/by_small_number.pyi unit_test_api/model/date_time_format.py +unit_test_api/model/date_time_format.pyi unit_test_api/model/email_format.py +unit_test_api/model/email_format.pyi unit_test_api/model/enum_with0_does_not_match_false.py +unit_test_api/model/enum_with0_does_not_match_false.pyi unit_test_api/model/enum_with1_does_not_match_true.py +unit_test_api/model/enum_with1_does_not_match_true.pyi unit_test_api/model/enum_with_escaped_characters.py +unit_test_api/model/enum_with_escaped_characters.pyi unit_test_api/model/enum_with_false_does_not_match0.py +unit_test_api/model/enum_with_false_does_not_match0.pyi unit_test_api/model/enum_with_true_does_not_match1.py +unit_test_api/model/enum_with_true_does_not_match1.pyi unit_test_api/model/enums_in_properties.py +unit_test_api/model/enums_in_properties.pyi unit_test_api/model/forbidden_property.py +unit_test_api/model/forbidden_property.pyi unit_test_api/model/hostname_format.py +unit_test_api/model/hostname_format.pyi unit_test_api/model/integer_type_matches_integers.py +unit_test_api/model/integer_type_matches_integers.pyi unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py +unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi unit_test_api/model/invalid_string_value_for_default.py +unit_test_api/model/invalid_string_value_for_default.pyi unit_test_api/model/ipv4_format.py +unit_test_api/model/ipv4_format.pyi unit_test_api/model/ipv6_format.py +unit_test_api/model/ipv6_format.pyi unit_test_api/model/json_pointer_format.py +unit_test_api/model/json_pointer_format.pyi unit_test_api/model/maximum_validation.py +unit_test_api/model/maximum_validation.pyi unit_test_api/model/maximum_validation_with_unsigned_integer.py +unit_test_api/model/maximum_validation_with_unsigned_integer.pyi unit_test_api/model/maxitems_validation.py +unit_test_api/model/maxitems_validation.pyi unit_test_api/model/maxlength_validation.py +unit_test_api/model/maxlength_validation.pyi unit_test_api/model/maxproperties0_means_the_object_is_empty.py +unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi unit_test_api/model/maxproperties_validation.py +unit_test_api/model/maxproperties_validation.pyi unit_test_api/model/minimum_validation.py +unit_test_api/model/minimum_validation.pyi unit_test_api/model/minimum_validation_with_signed_integer.py +unit_test_api/model/minimum_validation_with_signed_integer.pyi unit_test_api/model/minitems_validation.py +unit_test_api/model/minitems_validation.pyi unit_test_api/model/minlength_validation.py +unit_test_api/model/minlength_validation.pyi unit_test_api/model/minproperties_validation.py +unit_test_api/model/minproperties_validation.pyi unit_test_api/model/model_not.py +unit_test_api/model/model_not.pyi unit_test_api/model/nested_allof_to_check_validation_semantics.py +unit_test_api/model/nested_allof_to_check_validation_semantics.pyi unit_test_api/model/nested_anyof_to_check_validation_semantics.py +unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi unit_test_api/model/nested_items.py +unit_test_api/model/nested_items.pyi unit_test_api/model/nested_oneof_to_check_validation_semantics.py +unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi unit_test_api/model/not_more_complex_schema.py +unit_test_api/model/not_more_complex_schema.pyi unit_test_api/model/nul_characters_in_strings.py +unit_test_api/model/nul_characters_in_strings.pyi unit_test_api/model/null_type_matches_only_the_null_object.py +unit_test_api/model/null_type_matches_only_the_null_object.pyi unit_test_api/model/number_type_matches_numbers.py +unit_test_api/model/number_type_matches_numbers.pyi unit_test_api/model/object_properties_validation.py +unit_test_api/model/object_properties_validation.pyi unit_test_api/model/oneof.py +unit_test_api/model/oneof.pyi unit_test_api/model/oneof_complex_types.py +unit_test_api/model/oneof_complex_types.pyi unit_test_api/model/oneof_with_base_schema.py +unit_test_api/model/oneof_with_base_schema.pyi unit_test_api/model/oneof_with_empty_schema.py +unit_test_api/model/oneof_with_empty_schema.pyi unit_test_api/model/oneof_with_required.py +unit_test_api/model/oneof_with_required.pyi unit_test_api/model/pattern_is_not_anchored.py +unit_test_api/model/pattern_is_not_anchored.pyi unit_test_api/model/pattern_validation.py +unit_test_api/model/pattern_validation.pyi unit_test_api/model/properties_with_escaped_characters.py +unit_test_api/model/properties_with_escaped_characters.pyi unit_test_api/model/property_named_ref_that_is_not_a_reference.py +unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi unit_test_api/model/ref_in_additionalproperties.py +unit_test_api/model/ref_in_additionalproperties.pyi unit_test_api/model/ref_in_allof.py +unit_test_api/model/ref_in_allof.pyi unit_test_api/model/ref_in_anyof.py +unit_test_api/model/ref_in_anyof.pyi unit_test_api/model/ref_in_items.py +unit_test_api/model/ref_in_items.pyi unit_test_api/model/ref_in_not.py +unit_test_api/model/ref_in_not.pyi unit_test_api/model/ref_in_oneof.py +unit_test_api/model/ref_in_oneof.pyi unit_test_api/model/ref_in_property.py +unit_test_api/model/ref_in_property.pyi unit_test_api/model/required_default_validation.py +unit_test_api/model/required_default_validation.pyi unit_test_api/model/required_validation.py +unit_test_api/model/required_validation.pyi unit_test_api/model/required_with_empty_array.py +unit_test_api/model/required_with_empty_array.pyi unit_test_api/model/required_with_escaped_characters.py +unit_test_api/model/required_with_escaped_characters.pyi unit_test_api/model/simple_enum_validation.py +unit_test_api/model/simple_enum_validation.pyi unit_test_api/model/string_type_matches_strings.py +unit_test_api/model/string_type_matches_strings.pyi unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi unit_test_api/model/uniqueitems_false_validation.py +unit_test_api/model/uniqueitems_false_validation.pyi unit_test_api/model/uniqueitems_validation.py +unit_test_api/model/uniqueitems_validation.pyi unit_test_api/model/uri_format.py +unit_test_api/model/uri_format.pyi unit_test_api/model/uri_reference_format.py +unit_test_api/model/uri_reference_format.pyi unit_test_api/model/uri_template_format.py +unit_test_api/model/uri_template_format.pyi unit_test_api/models/__init__.py unit_test_api/rest.py unit_test_api/schemas.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md index 72052ca2e67..2633dfa1e86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md @@ -10931,7 +10931,7 @@ skip_deserialization | bool | default is False | when True, headers and body wil #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | @@ -11014,7 +11014,7 @@ headers | Unset | headers were not defined | #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md index 222140ad79f..76e909951ff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md @@ -5933,7 +5933,7 @@ skip_deserialization | bool | default is False | when True, headers and body wil #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md index afc26cec86c..ebc1a845d5d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md @@ -10931,7 +10931,7 @@ skip_deserialization | bool | default is False | when True, headers and body wil #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | @@ -11014,7 +11014,7 @@ headers | Unset | headers were not defined | #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md index c6769312ecd..28f5ac7d1f8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md @@ -474,7 +474,7 @@ skip_deserialization | bool | default is False | when True, headers and body wil #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | @@ -557,7 +557,7 @@ headers | Unset | headers were not defined | #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md index 4c6946eb07f..3cc97fed49d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md @@ -5056,7 +5056,7 @@ headers | Unset | headers were not defined | #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md index fdbb4771151..c77c8e2c9f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md @@ -3,7 +3,7 @@ #### Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | +**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | **foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | | 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 dcca5a7514b..51e2cda6075 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 @@ -25,6 +25,7 @@ from urllib3._collections import HTTPHeaderDict from urllib.parse import quote from urllib3.fields import RequestField as RequestFieldBase +import frozendict from unit_test_api import rest from unit_test_api.configuration import Configuration @@ -38,7 +39,6 @@ from unit_test_api.schemas import ( date, datetime, none_type, - frozendict, Unset, unset, ) @@ -67,7 +67,7 @@ class JSONEncoder(json.JSONEncoder): return None elif isinstance(obj, BoolClass): return bool(obj) - elif isinstance(obj, (dict, frozendict)): + elif isinstance(obj, (dict, frozendict.frozendict)): return {key: self.default(val) for key, val in obj.items()} elif isinstance(obj, (list, tuple)): return [self.default(item) for item in obj] @@ -478,7 +478,7 @@ class PathParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -596,7 +596,7 @@ class QueryParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: if self.schema: @@ -662,7 +662,7 @@ class CookieParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -734,7 +734,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -1359,8 +1359,8 @@ class RequestBody(StyleFormSerializer, JSONDetector): @staticmethod def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict): - raise ValueError('Unable to serialize type frozendict to text/plain') + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') elif isinstance(in_data, tuple): raise ValueError('Unable to serialize type tuple to text/plain') elif isinstance(in_data, NoneClass): @@ -1393,7 +1393,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): def __serialize_multipart_form_data( self, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') """ In a multipart/form-data request body, each schema property, or each element of a schema array property, @@ -1440,7 +1440,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): """ POST submission of form data in body """ - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) @@ -1462,7 +1462,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): media_type = self.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict)) and in_data: + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: cast_in_data = media_type.schema(**in_data) else: cast_in_data = media_type.schema(in_data) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py index ad727a30cea..bad897a1dd4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,16 +36,30 @@ class AdditionalpropertiesAllowsASchemaWhichShouldValidate( class properties: foo = schemas.AnyTypeSchema bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } additional_properties = schemas.BoolSchema foo: MetaOapg.properties.foo bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], ) -> 'AdditionalpropertiesAllowsASchemaWhichShouldValidate': diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi new file mode 100644 index 00000000000..bad897a1dd4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesAllowsASchemaWhichShouldValidate( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo = schemas.AnyTypeSchema + bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } + additional_properties = schemas.BoolSchema + + foo: MetaOapg.properties.foo + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'AdditionalpropertiesAllowsASchemaWhichShouldValidate': + return super().__new__( + cls, + *args, + foo=foo, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py index 16fb25e0259..759ece05528 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,19 +36,33 @@ class AdditionalpropertiesAreAllowedByDefault( class properties: foo = schemas.AnyTypeSchema bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AdditionalpropertiesAreAllowedByDefault': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi new file mode 100644 index 00000000000..759ece05528 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesAreAllowedByDefault( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo = schemas.AnyTypeSchema + bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AdditionalpropertiesAreAllowedByDefault': + return super().__new__( + cls, + *args, + foo=foo, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py index dff4c5918d3..827b0963d8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -36,10 +34,14 @@ class AdditionalpropertiesCanExistByItself( class MetaOapg: additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], ) -> 'AdditionalpropertiesCanExistByItself': diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi new file mode 100644 index 00000000000..827b0963d8a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesCanExistByItself( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'AdditionalpropertiesCanExistByItself': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 aa8c3505142..902a8be268a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -46,17 +44,27 @@ class AdditionalpropertiesShouldNotLookInApplicators( class MetaOapg: class properties: foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -81,10 +89,14 @@ class AdditionalpropertiesShouldNotLookInApplicators( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], ) -> 'AdditionalpropertiesShouldNotLookInApplicators': diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi new file mode 100644 index 00000000000..902a8be268a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AdditionalpropertiesShouldNotLookInApplicators( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + + class all_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + class properties: + foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'AdditionalpropertiesShouldNotLookInApplicators': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 6a22ff82a78..d2898588597 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -49,17 +47,27 @@ class Allof( } class properties: bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], bar: typing.Union[MetaOapg.properties.bar, int, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -81,17 +89,27 @@ class Allof( } class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], foo: typing.Union[MetaOapg.properties.foo, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -117,12 +135,16 @@ class Allof( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Allof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi new file mode 100644 index 00000000000..d2898588597 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Allof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "bar", + } + class properties: + bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) + + + class all_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "foo", + } + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Allof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 5e8ef76295e..f489c63653c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -47,12 +45,16 @@ class AllofCombinedWithAnyofOneof( additional_properties = schemas.AnyTypeSchema multiple_of = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -71,12 +73,16 @@ class AllofCombinedWithAnyofOneof( additional_properties = schemas.AnyTypeSchema multiple_of = 5 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_0': return super().__new__( cls, @@ -95,12 +101,16 @@ class AllofCombinedWithAnyofOneof( additional_properties = schemas.AnyTypeSchema multiple_of = 3 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_0': return super().__new__( cls, @@ -154,12 +164,16 @@ class AllofCombinedWithAnyofOneof( cls.any_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofCombinedWithAnyofOneof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi new file mode 100644 index 00000000000..bdb688aaaa2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofCombinedWithAnyofOneof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class one_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class any_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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, + ] + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + ] + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofCombinedWithAnyofOneof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 906799e8e1a..8c71189d34a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -47,12 +45,16 @@ class AllofSimpleTypes( additional_properties = schemas.AnyTypeSchema inclusive_maximum = 30 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -71,12 +73,16 @@ class AllofSimpleTypes( additional_properties = schemas.AnyTypeSchema inclusive_minimum = 20 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -101,12 +107,16 @@ class AllofSimpleTypes( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofSimpleTypes': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi new file mode 100644 index 00000000000..080696b60ae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofSimpleTypes( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class all_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofSimpleTypes': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 aae20d196c6..9493127bf94 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -40,6 +38,9 @@ class AllofWithBaseSchema( } class properties: bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema @@ -54,17 +55,27 @@ class AllofWithBaseSchema( } class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], foo: typing.Union[MetaOapg.properties.foo, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -86,17 +97,27 @@ class AllofWithBaseSchema( } class properties: baz = schemas.NoneSchema + __annotations__ = { + "baz": baz, + } additional_properties = schemas.AnyTypeSchema baz: MetaOapg.properties.baz + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], baz: typing.Union[MetaOapg.properties.baz, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -124,13 +145,20 @@ class AllofWithBaseSchema( bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], bar: typing.Union[MetaOapg.properties.bar, int, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofWithBaseSchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi new file mode 100644 index 00000000000..9493127bf94 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithBaseSchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "bar", + } + class properties: + bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "foo", + } + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + + class all_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "baz", + } + class properties: + baz = schemas.NoneSchema + __annotations__ = { + "baz": baz, + } + additional_properties = schemas.AnyTypeSchema + + + baz: MetaOapg.properties.baz + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + baz: typing.Union[MetaOapg.properties.baz, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + baz=baz, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofWithBaseSchema': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) 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 33a22fd6e6d..085c80dd4f4 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -53,12 +51,16 @@ class AllofWithOneEmptySchema( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofWithOneEmptySchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi new file mode 100644 index 00000000000..085c80dd4f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithOneEmptySchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofWithOneEmptySchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 6d84da0542b..2945f1b48e2 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class AllofWithTheFirstEmptySchema( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofWithTheFirstEmptySchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi new file mode 100644 index 00000000000..2945f1b48e2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTheFirstEmptySchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.AnyTypeSchema + all_of_1 = schemas.NumberSchema + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofWithTheFirstEmptySchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 6cc1aa17f66..e3a514849ff 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class AllofWithTheLastEmptySchema( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofWithTheLastEmptySchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi new file mode 100644 index 00000000000..e3a514849ff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTheLastEmptySchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.NumberSchema + all_of_1 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofWithTheLastEmptySchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 ad346907c85..a722042eef1 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class AllofWithTwoEmptySchemas( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AllofWithTwoEmptySchemas': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi new file mode 100644 index 00000000000..a722042eef1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AllofWithTwoEmptySchemas( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.AnyTypeSchema + all_of_1 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AllofWithTwoEmptySchemas': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 3edc5fae427..886640f429c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -48,12 +46,16 @@ class Anyof( additional_properties = schemas.AnyTypeSchema inclusive_minimum = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_1': return super().__new__( cls, @@ -78,12 +80,16 @@ class Anyof( cls.any_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Anyof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi new file mode 100644 index 00000000000..da054da8e89 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Anyof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + any_of_0 = schemas.IntSchema + + + class any_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + cls.any_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Anyof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 ac365c4d4b3..76b2ddfd04a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -49,17 +47,27 @@ class AnyofComplexTypes( } class properties: bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], bar: typing.Union[MetaOapg.properties.bar, int, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_0': return super().__new__( cls, @@ -81,17 +89,27 @@ class AnyofComplexTypes( } class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], foo: typing.Union[MetaOapg.properties.foo, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_1': return super().__new__( cls, @@ -117,12 +135,16 @@ class AnyofComplexTypes( cls.any_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AnyofComplexTypes': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi new file mode 100644 index 00000000000..76b2ddfd04a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofComplexTypes( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class any_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "bar", + } + class properties: + bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_0': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) + + + class any_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "foo", + } + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_1': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + cls.any_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AnyofComplexTypes': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 678486d5e10..0972a1afa20 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -47,12 +45,16 @@ class AnyofWithBaseSchema( additional_properties = schemas.AnyTypeSchema max_length = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_0': return super().__new__( cls, @@ -71,12 +73,16 @@ class AnyofWithBaseSchema( additional_properties = schemas.AnyTypeSchema min_length = 4 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_1': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi new file mode 100644 index 00000000000..f3b3f551667 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofWithBaseSchema( + schemas.ComposedBase, + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class any_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class any_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + cls.any_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'AnyofWithBaseSchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) 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 134bee36cc7..b9a9d502f89 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class AnyofWithOneEmptySchema( cls.any_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AnyofWithOneEmptySchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi new file mode 100644 index 00000000000..b9a9d502f89 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class AnyofWithOneEmptySchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + any_of_0 = schemas.NumberSchema + any_of_1 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + cls.any_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AnyofWithOneEmptySchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py index ea30435bdfd..7979cb58bf3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -39,7 +37,7 @@ class ArrayTypeMatchesArrays( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'ArrayTypeMatchesArrays': return super().__new__( @@ -48,5 +46,5 @@ class ArrayTypeMatchesArrays( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi new file mode 100644 index 00000000000..7979cb58bf3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ArrayTypeMatchesArrays( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + items = schemas.AnyTypeSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayTypeMatchesArrays': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py index c04139aa0d1..44a2063634a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 BooleanTypeMatchesBooleans = schemas.BoolSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi new file mode 100644 index 00000000000..44a2063634a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +BooleanTypeMatchesBooleans = schemas.BoolSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py index 0c42b6586ea..2545327dc96 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class ByInt( additional_properties = schemas.AnyTypeSchema multiple_of = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ByInt': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi new file mode 100644 index 00000000000..445c3f4bc7b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ByInt( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ByInt': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py index 1ca409d58cf..06bbbf60158 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class ByNumber( additional_properties = schemas.AnyTypeSchema multiple_of = 1.5 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ByNumber': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi new file mode 100644 index 00000000000..a9015a54502 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ByNumber( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ByNumber': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py index 47fa0999ff9..d855662f199 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class BySmallNumber( additional_properties = schemas.AnyTypeSchema multiple_of = 0.00010 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'BySmallNumber': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi new file mode 100644 index 00000000000..95e4a7313aa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class BySmallNumber( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'BySmallNumber': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py index 4e0149d929e..670858c4a6f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 DateTimeFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi new file mode 100644 index 00000000000..670858c4a6f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +DateTimeFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py index ab875f91065..f5969ebd284 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 EmailFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi new file mode 100644 index 00000000000..f5969ebd284 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +EmailFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py index 3c78c4ddeae..81e8578d6f0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi new file mode 100644 index 00000000000..81e8578d6f0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWith0DoesNotMatchFalse( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 0: "POSITIVE_0", + } + ), + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls(0) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py index 316db36f748..4fe7f02dfd2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi new file mode 100644 index 00000000000..4fe7f02dfd2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWith1DoesNotMatchTrue( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1: "POSITIVE_1", + } + ), + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py index eab4be7cd01..ad48c59127f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi new file mode 100644 index 00000000000..ad48c59127f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithEscapedCharacters( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "foo\nbar": "FOO_BAR", + "foo\rbar": "FOO_BAR", + } + ), + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def FOO_BAR(cls): + return cls("foo\nbar") + + @classmethod + @property + def FOO_BAR(cls): + return cls("foo\rbar") diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py index 2a447f89593..ebab77a099e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi new file mode 100644 index 00000000000..ebab77a099e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithFalseDoesNotMatch0( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + schemas.BoolClass.FALSE: "FALSE", + } + ), + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def FALSE(cls): + return cls(schemas.BoolClass.FALSE) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py index bbc35ed0551..60840ebba19 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi new file mode 100644 index 00000000000..60840ebba19 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumWithTrueDoesNotMatch1( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + schemas.BoolClass.TRUE: "TRUE", + } + ), + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def TRUE(cls): + return cls(schemas.BoolClass.TRUE) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py index 9869d50a94d..1a9ca47f276 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -41,21 +39,6 @@ class EnumsInProperties( class properties: - class foo( - schemas.SchemaEnumMakerClsFactory( - enum_value_to_name={ - "foo": "FOO", - } - ), - schemas.StrSchema - ): - - @classmethod - @property - def FOO(cls): - return cls("foo") - - class bar( schemas.SchemaEnumMakerClsFactory( enum_value_to_name={ @@ -69,18 +52,47 @@ class EnumsInProperties( @property def BAR(cls): return cls("bar") + + + class foo( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "foo": "FOO", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def FOO(cls): + return cls("foo") + __annotations__ = { + "bar": bar, + "foo": foo, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], bar: typing.Union[MetaOapg.properties.bar, str, ], foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'EnumsInProperties': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi new file mode 100644 index 00000000000..1a9ca47f276 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class EnumsInProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "bar", + } + class properties: + + + class bar( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "bar": "BAR", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def BAR(cls): + return cls("bar") + + + class foo( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "foo": "FOO", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def FOO(cls): + return cls("foo") + __annotations__ = { + "bar": bar, + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + bar: MetaOapg.properties.bar + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, ], + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'EnumsInProperties': + return super().__new__( + cls, + *args, + bar=bar, + foo=foo, + _configuration=_configuration, + **kwargs, + ) 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 6c61870411b..ca13c3eb13e 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -47,12 +45,16 @@ class ForbiddenProperty( additional_properties = schemas.AnyTypeSchema not_schema = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'foo': return super().__new__( cls, @@ -60,17 +62,27 @@ class ForbiddenProperty( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ForbiddenProperty': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi new file mode 100644 index 00000000000..ca13c3eb13e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ForbiddenProperty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class foo( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'foo': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ForbiddenProperty': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py index e9800ef5071..5bba13009bc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 HostnameFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi new file mode 100644 index 00000000000..5bba13009bc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +HostnameFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py index cb331f5daf2..0dabb992044 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 IntegerTypeMatchesIntegers = schemas.IntSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi new file mode 100644 index 00000000000..0dabb992044 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +IntegerTypeMatchesIntegers = schemas.IntSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py index bb581635eab..b542eb9beb4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi new file mode 100644 index 00000000000..831b928f25f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py index 6cbdd821053..91955175f29 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -45,17 +43,27 @@ class InvalidStringValueForDefault( class MetaOapg: min_length = 4 + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'InvalidStringValueForDefault': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi new file mode 100644 index 00000000000..7711a84cd98 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class InvalidStringValueForDefault( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class bar( + schemas.StrSchema + ): + pass + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'InvalidStringValueForDefault': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py index c3cd6afd105..2df78ce3fef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 Ipv4Format = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi new file mode 100644 index 00000000000..2df78ce3fef --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +Ipv4Format = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py index 09d7d1a12a1..4dd1c220797 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 Ipv6Format = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi new file mode 100644 index 00000000000..4dd1c220797 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +Ipv6Format = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py index 901c9ecfda9..95f8de8e183 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 JsonPointerFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi new file mode 100644 index 00000000000..95f8de8e183 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +JsonPointerFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py index b2235207e01..07d7bbd9d35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MaximumValidation( additional_properties = schemas.AnyTypeSchema inclusive_maximum = 3.0 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MaximumValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi new file mode 100644 index 00000000000..4a06145d44a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaximumValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MaximumValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py index b9a37250d58..8f29c362ba8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MaximumValidationWithUnsignedInteger( additional_properties = schemas.AnyTypeSchema inclusive_maximum = 300 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MaximumValidationWithUnsignedInteger': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi new file mode 100644 index 00000000000..0cf252536f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaximumValidationWithUnsignedInteger( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MaximumValidationWithUnsignedInteger': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py index b1886db94a5..388f059d50f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MaxitemsValidation( additional_properties = schemas.AnyTypeSchema max_items = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MaxitemsValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi new file mode 100644 index 00000000000..7641cc67061 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MaxitemsValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py index 7906651bf1d..244427aca8f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MaxlengthValidation( additional_properties = schemas.AnyTypeSchema max_length = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MaxlengthValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi new file mode 100644 index 00000000000..5faf2b929e3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxlengthValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MaxlengthValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py index 77c77f4e0ee..c4a1c51f461 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class Maxproperties0MeansTheObjectIsEmpty( additional_properties = schemas.AnyTypeSchema max_properties = 0 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Maxproperties0MeansTheObjectIsEmpty': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi new file mode 100644 index 00000000000..be884ca7d3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Maxproperties0MeansTheObjectIsEmpty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Maxproperties0MeansTheObjectIsEmpty': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py index f61e64a518b..57225ea0ef3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MaxpropertiesValidation( additional_properties = schemas.AnyTypeSchema max_properties = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MaxpropertiesValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi new file mode 100644 index 00000000000..cc2fa119762 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MaxpropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MaxpropertiesValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py index 9ca4b46e06b..1e968b95ba6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MinimumValidation( additional_properties = schemas.AnyTypeSchema inclusive_minimum = 1.1 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MinimumValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi new file mode 100644 index 00000000000..f8407fd31f4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinimumValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MinimumValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py index a36d83fb876..7c79bcbbeae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MinimumValidationWithSignedInteger( additional_properties = schemas.AnyTypeSchema inclusive_minimum = -2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MinimumValidationWithSignedInteger': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi new file mode 100644 index 00000000000..02ada1250af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinimumValidationWithSignedInteger( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MinimumValidationWithSignedInteger': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py index 648c99d88e6..fbbaed0fd5e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MinitemsValidation( additional_properties = schemas.AnyTypeSchema min_items = 1 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MinitemsValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi new file mode 100644 index 00000000000..eb34ff560fe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MinitemsValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py index 2ccfc98dc56..2c309798556 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MinlengthValidation( additional_properties = schemas.AnyTypeSchema min_length = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MinlengthValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi new file mode 100644 index 00000000000..5fa5b1ab158 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinlengthValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MinlengthValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py index a4b7eac9e41..0f94bec0e92 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class MinpropertiesValidation( additional_properties = schemas.AnyTypeSchema min_properties = 1 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MinpropertiesValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi new file mode 100644 index 00000000000..198e3f7ddab --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class MinpropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MinpropertiesValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 12874887b59..648245100b5 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class ModelNot( additional_properties = schemas.AnyTypeSchema not_schema = schemas.IntSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ModelNot': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi new file mode 100644 index 00000000000..648245100b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ModelNot( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.IntSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ModelNot': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 9653eb9b33b..4a9e6eee01e 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -62,12 +60,16 @@ class NestedAllofToCheckValidationSemantics( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_0': return super().__new__( cls, @@ -91,12 +93,16 @@ class NestedAllofToCheckValidationSemantics( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NestedAllofToCheckValidationSemantics': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi new file mode 100644 index 00000000000..4a9e6eee01e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedAllofToCheckValidationSemantics( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.NoneSchema + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NestedAllofToCheckValidationSemantics': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 723db11368d..95e87df250c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -62,12 +60,16 @@ class NestedAnyofToCheckValidationSemantics( cls.any_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'any_of_0': return super().__new__( cls, @@ -91,12 +93,16 @@ class NestedAnyofToCheckValidationSemantics( cls.any_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NestedAnyofToCheckValidationSemantics': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi new file mode 100644 index 00000000000..95e87df250c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedAnyofToCheckValidationSemantics( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class any_of_0( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + any_of_0 = schemas.NoneSchema + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'any_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NestedAnyofToCheckValidationSemantics': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py index 120abc7203d..30fcfc86ee8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -72,7 +70,7 @@ class NestedItems( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) def __new__( @@ -86,7 +84,7 @@ class NestedItems( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) def __new__( @@ -100,7 +98,7 @@ class NestedItems( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) def __new__( @@ -114,5 +112,5 @@ class NestedItems( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi new file mode 100644 index 00000000000..30fcfc86ee8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'NestedItems': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) 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 729bfeb75dd..dbc4b3b9894 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -62,12 +60,16 @@ class NestedOneofToCheckValidationSemantics( cls.one_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_0': return super().__new__( cls, @@ -91,12 +93,16 @@ class NestedOneofToCheckValidationSemantics( cls.one_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NestedOneofToCheckValidationSemantics': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi new file mode 100644 index 00000000000..dbc4b3b9894 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NestedOneofToCheckValidationSemantics( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class one_of_0( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_0 = schemas.NoneSchema + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NestedOneofToCheckValidationSemantics': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 283b0dca3f4..461039da718 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -46,16 +44,26 @@ class NotMoreComplexSchema( class MetaOapg: class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'not_schema': return super().__new__( cls, @@ -65,12 +73,16 @@ class NotMoreComplexSchema( **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NotMoreComplexSchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi new file mode 100644 index 00000000000..461039da718 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NotMoreComplexSchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class not_schema( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'not_schema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NotMoreComplexSchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py index 7179580b0c7..08fc1a4d78a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi new file mode 100644 index 00000000000..08fc1a4d78a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class NulCharactersInStrings( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "hello\x00there": "HELLOTHERE", + } + ), + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def HELLOTHERE(cls): + return cls("hello\x00there") diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py index c003aba0465..907f27ac892 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 NullTypeMatchesOnlyTheNullObject = schemas.NoneSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi new file mode 100644 index 00000000000..907f27ac892 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +NullTypeMatchesOnlyTheNullObject = schemas.NoneSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py index 6217c8336b3..ba02f9a9482 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 NumberTypeMatchesNumbers = schemas.NumberSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi new file mode 100644 index 00000000000..ba02f9a9482 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +NumberTypeMatchesNumbers = schemas.NumberSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py index 9ac7a0cf747..3b2b4e54314 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,19 +36,33 @@ class ObjectPropertiesValidation( class properties: foo = schemas.IntSchema bar = schemas.StrSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], foo: typing.Union[MetaOapg.properties.foo, int, schemas.Unset] = schemas.unset, bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectPropertiesValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi new file mode 100644 index 00000000000..3b2b4e54314 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class ObjectPropertiesValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo = schemas.IntSchema + bar = schemas.StrSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, int, schemas.Unset] = schemas.unset, + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectPropertiesValidation': + return super().__new__( + cls, + *args, + foo=foo, + bar=bar, + _configuration=_configuration, + **kwargs, + ) 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 91f070645cd..c4f82acff1a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -48,12 +46,16 @@ class Oneof( additional_properties = schemas.AnyTypeSchema inclusive_minimum = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_1': return super().__new__( cls, @@ -78,12 +80,16 @@ class Oneof( cls.one_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Oneof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi new file mode 100644 index 00000000000..60652d7f171 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class Oneof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_0 = schemas.IntSchema + + + class one_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + cls.one_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Oneof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 d8c45cc7041..fd6dfcacecc 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -49,17 +47,27 @@ class OneofComplexTypes( } class properties: bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], bar: typing.Union[MetaOapg.properties.bar, int, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_0': return super().__new__( cls, @@ -81,17 +89,27 @@ class OneofComplexTypes( } class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], foo: typing.Union[MetaOapg.properties.foo, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_1': return super().__new__( cls, @@ -117,12 +135,16 @@ class OneofComplexTypes( cls.one_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'OneofComplexTypes': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi new file mode 100644 index 00000000000..fd6dfcacecc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofComplexTypes( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class one_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "bar", + } + class properties: + bar = schemas.IntSchema + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_0': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) + + + class one_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "foo", + } + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_1': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + cls.one_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'OneofComplexTypes': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 63f0250877c..c9ad6999bda 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -47,12 +45,16 @@ class OneofWithBaseSchema( additional_properties = schemas.AnyTypeSchema min_length = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_0': return super().__new__( cls, @@ -71,12 +73,16 @@ class OneofWithBaseSchema( additional_properties = schemas.AnyTypeSchema max_length = 4 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_1': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi new file mode 100644 index 00000000000..6d882521c90 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithBaseSchema( + schemas.ComposedBase, + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class one_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class one_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + cls.one_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'OneofWithBaseSchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) 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 4c692af7319..bd777f2a444 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class OneofWithEmptySchema( cls.one_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'OneofWithEmptySchema': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi new file mode 100644 index 00000000000..bd777f2a444 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithEmptySchema( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_0 = schemas.NumberSchema + one_of_1 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + cls.one_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'OneofWithEmptySchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 875588226b5..bc1f1d9a6fd 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -54,12 +52,22 @@ class OneofWithRequired( bar: MetaOapg.additional_properties foo: MetaOapg.additional_properties + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_0': return super().__new__( cls, @@ -84,12 +92,22 @@ class OneofWithRequired( foo: MetaOapg.additional_properties baz: MetaOapg.additional_properties + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_1': return super().__new__( cls, @@ -114,12 +132,16 @@ class OneofWithRequired( cls.one_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'OneofWithRequired': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi new file mode 100644 index 00000000000..bc1f1d9a6fd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class OneofWithRequired( + schemas.ComposedBase, + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class one_of_0( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "bar", + "foo", + } + additional_properties = schemas.AnyTypeSchema + + + bar: MetaOapg.additional_properties + foo: MetaOapg.additional_properties + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_0': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class one_of_1( + schemas.AnyTypeSchema, + ): + + + class MetaOapg: + required = { + "foo", + "baz", + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.additional_properties + baz: MetaOapg.additional_properties + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_1': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + cls.one_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'OneofWithRequired': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py index 3af5c3dbf4c..3fda53eb614 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -40,12 +38,16 @@ class PatternIsNotAnchored( 'pattern': r'a+', # noqa: E501 }] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'PatternIsNotAnchored': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi new file mode 100644 index 00000000000..3da4fc48317 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PatternIsNotAnchored( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'PatternIsNotAnchored': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py index e002eb177b0..5845f53bd38 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -40,12 +38,16 @@ class PatternValidation( 'pattern': r'^a*$', # noqa: E501 }] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'PatternValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi new file mode 100644 index 00000000000..31dc0395c7e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PatternValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'PatternValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py index 5693faa67b7..413809f98b3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -36,93 +34,51 @@ class PropertiesWithEscapedCharacters( class MetaOapg: class properties: - foobar = schemas.NumberSchema - locals()["foo\nbar"] = foobar - del locals()['foobar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ - foobar = schemas.NumberSchema - locals()["foo\"bar"] = foobar - del locals()['foobar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + foo_nbar = schemas.NumberSchema foo_bar = schemas.NumberSchema - locals()["foo\\bar"] = foo_bar - del locals()['foo_bar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ - foobar = schemas.NumberSchema - locals()["foo\rbar"] = foobar - del locals()['foobar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ - foobar = schemas.NumberSchema - locals()["foo\tbar"] = foobar - del locals()['foobar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ - foobar = schemas.NumberSchema - locals()["foo\fbar"] = foobar - del locals()['foobar'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + foo__bar = schemas.NumberSchema + foo_rbar = schemas.NumberSchema + foo_tbar = schemas.NumberSchema + foo_fbar = schemas.NumberSchema + __annotations__ = { + "foo\nbar": foo_nbar, + "foo\"bar": foo_bar, + "foo\\bar": foo__bar, + "foo\rbar": foo_rbar, + "foo\tbar": foo_tbar, + "foo\fbar": foo_fbar, + } additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\nbar"]) -> MetaOapg.properties.foo_nbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\"bar"]) -> MetaOapg.properties.foo_bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\bar"]) -> MetaOapg.properties.foo__bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\rbar"]) -> MetaOapg.properties.foo_rbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\tbar"]) -> MetaOapg.properties.foo_tbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\fbar"]) -> MetaOapg.properties.foo_fbar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'PropertiesWithEscapedCharacters': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi new file mode 100644 index 00000000000..413809f98b3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PropertiesWithEscapedCharacters( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo_nbar = schemas.NumberSchema + foo_bar = schemas.NumberSchema + foo__bar = schemas.NumberSchema + foo_rbar = schemas.NumberSchema + foo_tbar = schemas.NumberSchema + foo_fbar = schemas.NumberSchema + __annotations__ = { + "foo\nbar": foo_nbar, + "foo\"bar": foo_bar, + "foo\\bar": foo__bar, + "foo\rbar": foo_rbar, + "foo\tbar": foo_tbar, + "foo\fbar": foo_fbar, + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\nbar"]) -> MetaOapg.properties.foo_nbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\"bar"]) -> MetaOapg.properties.foo_bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\bar"]) -> MetaOapg.properties.foo__bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\rbar"]) -> MetaOapg.properties.foo_rbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\tbar"]) -> MetaOapg.properties.foo_tbar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\fbar"]) -> MetaOapg.properties.foo_fbar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'PropertiesWithEscapedCharacters': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py index 285c9ef6658..ce78f101833 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -37,27 +35,25 @@ class PropertyNamedRefThatIsNotAReference( class MetaOapg: class properties: ref = schemas.StrSchema - locals()["$ref"] = ref - del locals()['ref'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + __annotations__ = { + "$ref": ref, + } additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["$ref"]) -> MetaOapg.properties.ref: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'PropertyNamedRefThatIsNotAReference': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi new file mode 100644 index 00000000000..ce78f101833 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class PropertyNamedRefThatIsNotAReference( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + ref = schemas.StrSchema + __annotations__ = { + "$ref": ref, + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["$ref"]) -> MetaOapg.properties.ref: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'PropertyNamedRefThatIsNotAReference': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py index f5b9a9da07f..7af32fe4370 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -40,10 +38,14 @@ class RefInAdditionalproperties( @property def additional_properties(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: return PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> 'PropertyNamedRefThatIsNotAReference': + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: 'PropertyNamedRefThatIsNotAReference', ) -> 'RefInAdditionalproperties': diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi new file mode 100644 index 00000000000..7af32fe4370 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAdditionalproperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def additional_properties(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> 'PropertyNamedRefThatIsNotAReference': + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: 'PropertyNamedRefThatIsNotAReference', + ) -> 'RefInAdditionalproperties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py index fb36ddcd361..4677f4717e5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -52,12 +50,16 @@ class RefInAllof( PropertyNamedRefThatIsNotAReference, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RefInAllof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi new file mode 100644 index 00000000000..4677f4717e5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAllof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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 [ + PropertyNamedRefThatIsNotAReference, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RefInAllof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py index d66c5bd5c7e..0410d56ace9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -52,12 +50,16 @@ class RefInAnyof( PropertyNamedRefThatIsNotAReference, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RefInAnyof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi new file mode 100644 index 00000000000..0410d56ace9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInAnyof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def any_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 [ + PropertyNamedRefThatIsNotAReference, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RefInAnyof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py index 6c0f9d5ada2..1287dd16364 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -52,7 +50,7 @@ class RefInItems( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'PropertyNamedRefThatIsNotAReference': return super().__getitem__(i) from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi new file mode 100644 index 00000000000..1287dd16364 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + + def __new__( + cls, + arg: typing.Union[typing.Tuple['PropertyNamedRefThatIsNotAReference'], typing.List['PropertyNamedRefThatIsNotAReference']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'RefInItems': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'PropertyNamedRefThatIsNotAReference': + return super().__getitem__(i) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py index 4855b4a7178..1b444394c51 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -42,12 +40,16 @@ class RefInNot( def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: return PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RefInNot': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi new file mode 100644 index 00000000000..1b444394c51 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInNot( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RefInNot': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py index d87a95f3359..08b14af270f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -52,12 +50,16 @@ class RefInOneof( PropertyNamedRefThatIsNotAReference, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RefInOneof': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi new file mode 100644 index 00000000000..08b14af270f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInOneof( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + PropertyNamedRefThatIsNotAReference, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RefInOneof': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py index 7e45ff50284..824ff25cd65 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -41,17 +39,27 @@ class RefInProperty( @property def a(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: return PropertyNamedRefThatIsNotAReference + __annotations__ = { + "a": a, + } additional_properties = schemas.AnyTypeSchema a: 'PropertyNamedRefThatIsNotAReference' + + @typing.overload + def __getitem__(self, name: typing.Literal["a"]) -> 'PropertyNamedRefThatIsNotAReference': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], a: typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RefInProperty': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi new file mode 100644 index 00000000000..824ff25cd65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RefInProperty( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + @classmethod + @property + def a(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + __annotations__ = { + "a": a, + } + additional_properties = schemas.AnyTypeSchema + + + a: 'PropertyNamedRefThatIsNotAReference' + + @typing.overload + def __getitem__(self, name: typing.Literal["a"]) -> 'PropertyNamedRefThatIsNotAReference': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + a: typing.Union['PropertyNamedRefThatIsNotAReference', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RefInProperty': + return super().__new__( + cls, + *args, + a=a, + _configuration=_configuration, + **kwargs, + ) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py index f48938c0d34..0e4534568a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -37,17 +35,27 @@ class RequiredDefaultValidation( class MetaOapg: class properties: foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RequiredDefaultValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi new file mode 100644 index 00000000000..0e4534568a8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredDefaultValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RequiredDefaultValidation': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py index 8ab6fbf82dc..a57eeec5452 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -41,19 +39,33 @@ class RequiredValidation( class properties: foo = schemas.AnyTypeSchema bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - bar: typing.Union[MetaOapg.properties.bar, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RequiredValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi new file mode 100644 index 00000000000..a57eeec5452 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "foo", + } + class properties: + foo = schemas.AnyTypeSchema + bar = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + bar: typing.Union[MetaOapg.properties.bar, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RequiredValidation': + return super().__new__( + cls, + *args, + foo=foo, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py index 5bbfe97730b..f6313dd1aab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -37,17 +35,27 @@ class RequiredWithEmptyArray( class MetaOapg: class properties: foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - foo: typing.Union[MetaOapg.properties.foo, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RequiredWithEmptyArray': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi new file mode 100644 index 00000000000..f6313dd1aab --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredWithEmptyArray( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + foo = schemas.AnyTypeSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + foo: typing.Union[MetaOapg.properties.foo, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RequiredWithEmptyArray': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py index 42bd88a1e76..13375bda4b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -46,12 +44,34 @@ class RequiredWithEscapedCharacters( additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'RequiredWithEscapedCharacters': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi new file mode 100644 index 00000000000..13375bda4b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class RequiredWithEscapedCharacters( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "foo\"bar", + "foo\nbar", + "foo\fbar", + "foo\tbar", + "foo\rbar", + "foo\\bar", + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'RequiredWithEscapedCharacters': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py index db57491a39e..09779d99587 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi new file mode 100644 index 00000000000..09779d99587 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class SimpleEnumValidation( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1: "POSITIVE_1", + 2: "POSITIVE_2", + 3: "POSITIVE_3", + } + ), + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) + + @classmethod + @property + def POSITIVE_2(cls): + return cls(2) + + @classmethod + @property + def POSITIVE_3(cls): + return cls(3) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py index 63e434853ba..715ff56e9b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 StringTypeMatchesStrings = schemas.StrSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi new file mode 100644 index 00000000000..715ff56e9b2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +StringTypeMatchesStrings = schemas.StrSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py index d3a8c6e6fd4..4ce74c7148a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -45,16 +43,26 @@ class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( class MetaOapg: inclusive_maximum = 3 + __annotations__ = { + "alpha": alpha, + } additional_properties = schemas.AnyTypeSchema alpha: MetaOapg.properties.alpha + + @typing.overload + def __getitem__(self, name: typing.Literal["alpha"]) -> MetaOapg.properties.alpha: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], alpha: typing.Union[MetaOapg.properties.alpha, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi new file mode 100644 index 00000000000..d675b520165 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class alpha( + schemas.NumberSchema + ): + pass + __annotations__ = { + "alpha": alpha, + } + additional_properties = schemas.AnyTypeSchema + + alpha: MetaOapg.properties.alpha + + @typing.overload + def __getitem__(self, name: typing.Literal["alpha"]) -> MetaOapg.properties.alpha: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + alpha: typing.Union[MetaOapg.properties.alpha, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing': + return super().__new__( + cls, + *args, + alpha=alpha, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py index fd77f59ba92..46b2ab73de6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class UniqueitemsFalseValidation( additional_properties = schemas.AnyTypeSchema unique_items = False + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'UniqueitemsFalseValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi new file mode 100644 index 00000000000..1eaa1160de6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UniqueitemsFalseValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'UniqueitemsFalseValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py index cac14b11977..50a41962f0f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class UniqueitemsValidation( additional_properties = schemas.AnyTypeSchema unique_items = True + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'UniqueitemsValidation': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi new file mode 100644 index 00000000000..738ac726ada --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + +class UniqueitemsValidation( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'UniqueitemsValidation': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py index 6206699b23e..dd7b1cc00f9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 UriFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi new file mode 100644 index 00000000000..dd7b1cc00f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +UriFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py index 38c9caecac8..20539053ac1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 UriReferenceFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi new file mode 100644 index 00000000000..20539053ac1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +UriReferenceFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py index 50c91dbfcab..fcd9c5a37e8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 UriTemplateFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi new file mode 100644 index 00000000000..fcd9c5a37e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + openapi 3.0.3 sample spec + + sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 + + The version of the OpenAPI document: 0.0.1 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 +UriTemplateFormat = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py index b1e35d7223c..e38c86a3a78 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi new file mode 100644 index 00000000000..dacbe10c878 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py index c8c54b3c409..8f2b2fd167d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi new file mode 100644 index 00000000000..190c7b3a941 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py index 752b54a26c2..e55f8f01ac1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi new file mode 100644 index 00000000000..ee4d70ad454 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py index b74a4ec9838..597e0fc2e91 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi new file mode 100644 index 00000000000..cda3403c2a3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py index 7aea76383b9..a4e96208f8d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi new file mode 100644 index 00000000000..2aefadbfd07 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py index 5d89bb67196..ed83dfa0ca3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi new file mode 100644 index 00000000000..9b3664382d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = Allof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py index dc1dd6b8946..28709e44401 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi new file mode 100644 index 00000000000..1b0d128208c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofSimpleTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py index a8dc1bc5e03..3dde3bc4064 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi new file mode 100644 index 00000000000..6758bf77b4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py index 3359b0725d9..718a98ae641 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi new file mode 100644 index 00000000000..1ad4b7cd539 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py index e03eca9c8c5..a7667293d62 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi new file mode 100644 index 00000000000..f2f189a4b9c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py index ea8cb85ad6e..b758b1a47e5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi new file mode 100644 index 00000000000..ec6dd4c3ad5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py index aaa81465ef1..b934f3ab0f5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi new file mode 100644 index 00000000000..9861de1548a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py index e0b873919ac..b81d7c29db3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi new file mode 100644 index 00000000000..094253c7279 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AnyofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py index e43698cd2d9..bb64c9144ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi new file mode 100644 index 00000000000..af827fe77e4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = Anyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py index 0d8baf9dfc3..fcc6406b1e8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi new file mode 100644 index 00000000000..bc727c43fe0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py index 6a06ef848c7..cb1317b9a52 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi new file mode 100644 index 00000000000..9ea25220f85 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py index 95dd1311b18..60f6199d977 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi new file mode 100644 index 00000000000..f7c446db928 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py index e32091ad1cd..9b3f1f0051d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi new file mode 100644 index 00000000000..f9d64759757 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.BoolSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py index 1fffbebcb13..ed050e92212 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi new file mode 100644 index 00000000000..a886ae60018 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ByInt diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py index 4e343828b0c..a3379a757c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi new file mode 100644 index 00000000000..b2b57fe8975 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ByNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py index 91ac99f7856..da9c81268bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi new file mode 100644 index 00000000000..a375c52b42f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = BySmallNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py index b5bc4f5ec0a..1d0a4996852 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_date_time_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostDateTimeFormatRequestBody(BaseApi): def post_date_time_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py index 28ee5ed6b6b..daf36c3a062 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_email_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostEmailFormatRequestBody(BaseApi): def post_email_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py index 503ad9c6f07..f76a6608934 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi new file mode 100644 index 00000000000..2a7336d096d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py index 093306ed7c0..2f2d094d7d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi new file mode 100644 index 00000000000..fdad2525546 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py index f3a7113f85f..3c330d8cbbb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi new file mode 100644 index 00000000000..887afef899c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py index a000616aa61..1dbe3330338 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi new file mode 100644 index 00000000000..262e61247a3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py index 745cb5b3f70..d16197748a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi new file mode 100644 index 00000000000..15d29dffa59 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py index 9d6e6771810..a5387c77c6a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi new file mode 100644 index 00000000000..e9a9d35d374 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = EnumsInProperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py index 4d213e147bf..859f979561b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi new file mode 100644 index 00000000000..83803f33f7c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ForbiddenProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py index f329cf567ea..741dd0abf48 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_hostname_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostHostnameFormatRequestBody(BaseApi): def post_hostname_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py index 867d3575d03..472c5563b75 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi new file mode 100644 index 00000000000..b76c07d273a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.IntSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py index f4c42c8a3d3..a6908fca99b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi new file mode 100644 index 00000000000..43e11030997 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py index 124880e4190..86e6095dd4d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi new file mode 100644 index 00000000000..ad90be5f9c1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py index b2ae3bcac83..8a6de629ebd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_ipv4_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostIpv4FormatRequestBody(BaseApi): def post_ipv4_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py index 336a9c9203b..d8888a34136 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_ipv6_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostIpv6FormatRequestBody(BaseApi): def post_ipv6_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py index fe31d7b93d3..d2b903bd869 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_json_pointer_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostJsonPointerFormatRequestBody(BaseApi): def post_json_pointer_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py index 582aa5e18e1..231fcd61e55 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi new file mode 100644 index 00000000000..492cf620158 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py index 0567fbfe722..9b3e0db1ccd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi new file mode 100644 index 00000000000..ab6f0b52479 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py index 9cc7aec7360..15aed430073 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi new file mode 100644 index 00000000000..fc0ec258055 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MaxitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py index 99068ce1e68..572291b882a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi new file mode 100644 index 00000000000..2ae397e9431 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MaxlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py index c54b6ce7759..5a0c3ea4379 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi new file mode 100644 index 00000000000..94c7edd89ee --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py index f46d2a61d04..29076980d9c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi new file mode 100644 index 00000000000..af838df94d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MaxpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py index 7758b3f493c..8e677b6a2dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi new file mode 100644 index 00000000000..61f65b2cf4a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py index 211d129404d..8acbc5b12aa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi new file mode 100644 index 00000000000..db35d569ce1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py index 3a85db8c17f..0a015da2e9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi new file mode 100644 index 00000000000..808df3d5c5d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MinitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py index b6c5b04d091..07884cebdb3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi new file mode 100644 index 00000000000..aba69ad80af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MinlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py index 7c82b052a4a..34caea949b3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi new file mode 100644 index 00000000000..401cc7c9679 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = MinpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py index 053da334035..b407a6c8f95 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi new file mode 100644 index 00000000000..018f1e11ae4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py index 189547a1d93..afb7aa9371c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi new file mode 100644 index 00000000000..68b36668f3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py index fef2ea0f947..34c0458fa8b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi new file mode 100644 index 00000000000..6253862d554 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NestedItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py index 4ddafbf2aa1..f4a9bb68f5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi new file mode 100644 index 00000000000..884f9ada51e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics 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 49b78114b08..b65bdb9c86b 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -44,16 +45,26 @@ class SchemaForRequestBodyApplicationJson( class MetaOapg: class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'not_schema': return super().__new__( cls, @@ -63,12 +74,16 @@ class SchemaForRequestBodyApplicationJson( **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, @@ -106,7 +121,7 @@ class BaseApi(api_client.Api): def _post_not_more_complex_schema_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -166,7 +181,7 @@ class PostNotMoreComplexSchemaRequestBody(BaseApi): def post_not_more_complex_schema_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -189,7 +204,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi 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.pyi new file mode 100644 index 00000000000..05005f632ba --- /dev/null +++ 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.pyi @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class not_schema( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'not_schema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 ac624957d5f..0170027fc9a 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -36,12 +37,16 @@ class SchemaForRequestBodyApplicationJson( additional_properties = schemas.AnyTypeSchema not_schema = schemas.IntSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, @@ -79,7 +84,7 @@ class BaseApi(api_client.Api): def _post_not_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +144,7 @@ class PostNotRequestBody(BaseApi): def post_not_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -162,7 +167,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi new file mode 100644 index 00000000000..6a12f1f091e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.IntSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py index 8e9947d0f36..a2c3b5ca9c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi new file mode 100644 index 00000000000..63fffee06fb --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NulCharactersInStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py index a8f4f3c4554..a03c1f5ab62 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi new file mode 100644 index 00000000000..9fe002119ca --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.NoneSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py index 812b60260b3..245e6fed4db 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi new file mode 100644 index 00000000000..9aaa6576ca6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.NumberSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py index 6ccfb0fb955..a469101fed6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi new file mode 100644 index 00000000000..39642c202d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py index 67e0355eaeb..2a141afc7ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_object_type_matches_objects_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostObjectTypeMatchesObjectsRequestBody(BaseApi): def post_object_type_matches_objects_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, 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/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi new file mode 100644 index 00000000000..e54316eede9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.DictSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py index f60b76b5dd7..9a33ab54714 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi new file mode 100644 index 00000000000..c8599cdb2a6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = OneofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py index c0584953bbe..db1e59a3ced 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi new file mode 100644 index 00000000000..c61624078e1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = Oneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py index d1b7ecd2375..54001b56c36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi new file mode 100644 index 00000000000..400b01749c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = OneofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py index 8f239edea29..a476b954e88 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi new file mode 100644 index 00000000000..a4eeba61800 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = OneofWithEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py index c72cc3ddc4f..9ce4f5dbad9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi new file mode 100644 index 00000000000..2b45058e04e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = OneofWithRequired diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py index a216bc61208..692f2a04aae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi new file mode 100644 index 00000000000..b2fbdc5eabf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = PatternIsNotAnchored diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py index 4e49fd05aeb..92dadaf132c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi new file mode 100644 index 00000000000..566cb268912 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = PatternValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py index 0d5976b7b34..d7f8aec70d2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi new file mode 100644 index 00000000000..c0145902da2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py index 0cebb222c13..f0ccf44db8e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi new file mode 100644 index 00000000000..50d360afdbc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py index 63e756f742f..92459b10346 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi new file mode 100644 index 00000000000..67af5469732 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInAdditionalproperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py index 191637e0447..934e447b59d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi new file mode 100644 index 00000000000..a13d5ccf0ae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInAllof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py index 765fff48553..c8abee27159 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi new file mode 100644 index 00000000000..90cb9393faa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInAnyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py index 7d67f3acde8..d98da3028cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi new file mode 100644 index 00000000000..b28dbfbc756 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py index 203182e8fb1..08153b7a3c6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 @@ -42,12 +43,16 @@ class SchemaForRequestBodyApplicationJson( def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: return PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, @@ -85,7 +90,7 @@ class BaseApi(api_client.Api): def _post_ref_in_not_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -145,7 +150,7 @@ class PostRefInNotRequestBody(BaseApi): def post_ref_in_not_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,7 +173,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi new file mode 100644 index 00000000000..20bc5835756 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py index 000e0052be5..bf6a534b9e9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi new file mode 100644 index 00000000000..fd987a14bf5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py index 17670e50286..7e18328233d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi new file mode 100644 index 00000000000..5de3bd560c9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RefInProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py index ca93f1c0507..28529402a19 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi new file mode 100644 index 00000000000..7d2918f0cd9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RequiredDefaultValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py index 4288b76c23f..54360fc5142 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi new file mode 100644 index 00000000000..a5d68bfceee --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RequiredValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py index d77c9dede87..3f2c01ad075 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi new file mode 100644 index 00000000000..cd38f4dad75 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py index 99feda92290..d758957e97a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -44,12 +45,34 @@ class SchemaForRequestBodyApplicationJson( additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, @@ -87,7 +110,7 @@ class BaseApi(api_client.Api): def _post_required_with_escaped_characters_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -147,7 +170,7 @@ class PostRequiredWithEscapedCharactersRequestBody(BaseApi): def post_required_with_escaped_characters_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -170,7 +193,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi new file mode 100644 index 00000000000..c178c4241c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.AnyTypeSchema, +): + + + class MetaOapg: + required = { + "foo\"bar", + "foo\nbar", + "foo\fbar", + "foo\tbar", + "foo\rbar", + "foo\\bar", + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py index b21399de66d..cd2c376773a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi new file mode 100644 index 00000000000..bbc60803846 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = SimpleEnumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py index ba0ca2f84ce..0dc8f74b836 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi new file mode 100644 index 00000000000..90ae9366371 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.StrSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py index e4a3563334a..ad6132923c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi new file mode 100644 index 00000000000..afccbdc4799 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py index 13fcc45c486..fc0bff81195 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi new file mode 100644 index 00000000000..80cd975d753 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py index 45367dbaa26..d81215405f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi new file mode 100644 index 00000000000..2152232e97e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py index 510abf55ff1..df5c0d99869 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_uri_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostUriFormatRequestBody(BaseApi): def post_uri_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py index 21b6649645a..1f79dfc4993 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_uri_reference_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostUriReferenceFormatRequestBody(BaseApi): def post_uri_reference_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py index b817b2c57ff..beccabb0d82 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -56,7 +57,7 @@ class BaseApi(api_client.Api): def _post_uri_template_format_request_body( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -116,7 +117,7 @@ class PostUriTemplateFormatRequestBody(BaseApi): def post_uri_template_format_request_body( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -139,7 +140,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], 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-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi new file mode 100644 index 00000000000..3f0586bd8f9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi @@ -0,0 +1,27 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_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_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py index 007bd5088b7..0deafad7561 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_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_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..cbeef04377f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_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_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py index 1a90dd36a8f..284d3016000 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_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_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..dec70bb071b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_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_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py index 6b0faa82159..c0d54a0af02 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_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_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..a1f6a959bb8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesCanExistByItself diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_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_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py index 037879b4c8d..40e6b0bd66e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_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_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..cf6e0ed18b7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_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_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py index 980b07cadc0..9329afc6e65 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_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_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..0f20bc3632e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofCombinedWithAnyofOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_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_allof_response_body_for_content_types/post.py index 2851c5b1a1b..cf208fcf0fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_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_allof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..16a427b1516 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = Allof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_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_allof_simple_types_response_body_for_content_types/post.py index 1d1b3518a67..b672f1547d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_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_allof_simple_types_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..f3905bac91c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofSimpleTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_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_allof_with_base_schema_response_body_for_content_types/post.py index 46945262442..291875aa83d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_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_allof_with_base_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..0b4cc4debdd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_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_allof_with_one_empty_schema_response_body_for_content_types/post.py index 5d2cb528a74..23bf4e09a91 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_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_allof_with_one_empty_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..6c0c4693871 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_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_allof_with_the_first_empty_schema_response_body_for_content_types/post.py index 1af0132c595..0696560731e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_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_allof_with_the_first_empty_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..4a19d8f086d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofWithTheFirstEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_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_allof_with_the_last_empty_schema_response_body_for_content_types/post.py index 3777927a4b6..a90411dc02d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_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_allof_with_the_last_empty_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7e4e2d1d472 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofWithTheLastEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_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_allof_with_two_empty_schemas_response_body_for_content_types/post.py index 48d83cbd274..b79d8a337a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_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_allof_with_two_empty_schemas_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..72ef64d1867 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AllofWithTwoEmptySchemas diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_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_anyof_complex_types_response_body_for_content_types/post.py index d3824d4e7f2..fee67a04cca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_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_anyof_complex_types_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..bd02ae54dc8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AnyofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_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_anyof_response_body_for_content_types/post.py index 8cc29807f34..de948b38684 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_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_anyof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7bb8ff6cfba --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = Anyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_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_anyof_with_base_schema_response_body_for_content_types/post.py index ca6d797a09f..e4cc19e6d50 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_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_anyof_with_base_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..bee8cc95b7a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AnyofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_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_anyof_with_one_empty_schema_response_body_for_content_types/post.py index 059c0348a55..a8f7ed5341c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_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_anyof_with_one_empty_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..9c1937a9465 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = AnyofWithOneEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_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_array_type_matches_arrays_response_body_for_content_types/post.py index fdcd1d6dbc9..5e2d015aff3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_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_array_type_matches_arrays_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..baa0184f27f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = ArrayTypeMatchesArrays diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_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_boolean_type_matches_booleans_response_body_for_content_types/post.py index 86db51b8af9..d493c875baf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_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_boolean_type_matches_booleans_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..d1d20fba59e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_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_by_int_response_body_for_content_types/post.py index 938a6bce7c7..e0b6241b95f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_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_by_int_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7b050b6841b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = ByInt diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_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_by_number_response_body_for_content_types/post.py index fe2aae5bafb..4235bdab624 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_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_by_number_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..a89460438ce --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = ByNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_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_by_small_number_response_body_for_content_types/post.py index e1570ceaeb6..0b591d49dd9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_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_by_small_number_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..51c0f6f5618 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = BySmallNumber diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_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_date_time_format_response_body_for_content_types/post.py index 67bdeb8f053..1a61eb3c888 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_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_date_time_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_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_email_format_response_body_for_content_types/post.py index 5cc48b2f0f1..00f3e90216a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_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_email_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_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_enum_with0_does_not_match_false_response_body_for_content_types/post.py index 55e9ef83dbc..1ed0d7f02ec 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_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_enum_with0_does_not_match_false_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..31d261e68e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumWith0DoesNotMatchFalse diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_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_enum_with1_does_not_match_true_response_body_for_content_types/post.py index 52167ae01f9..4fa049d64e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_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_enum_with1_does_not_match_true_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..692a20724c4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumWith1DoesNotMatchTrue diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_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_enum_with_escaped_characters_response_body_for_content_types/post.py index 520f858be80..7fc9588ce28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_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_enum_with_escaped_characters_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..127cb370996 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_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_enum_with_false_does_not_match0_response_body_for_content_types/post.py index 4d76f9886e8..c8e72f4c3ec 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_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_enum_with_false_does_not_match0_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..60612526728 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumWithFalseDoesNotMatch0 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_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_enum_with_true_does_not_match1_response_body_for_content_types/post.py index da15a56a1a8..fbe5ce3bafd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_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_enum_with_true_does_not_match1_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..9db4672b5f2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumWithTrueDoesNotMatch1 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_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_enums_in_properties_response_body_for_content_types/post.py index 635b3941feb..19b45b8f24a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_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_enums_in_properties_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7cce00d8d3c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = EnumsInProperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_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_forbidden_property_response_body_for_content_types/post.py index 6bd8c738c66..84dbe1eb877 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_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_forbidden_property_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..ec17e343afa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = ForbiddenProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_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_hostname_format_response_body_for_content_types/post.py index 523fc3cf1e4..124b631b1da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_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_hostname_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_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_integer_type_matches_integers_response_body_for_content_types/post.py index c2fbcd487d0..be5fbe9a4ad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_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_integer_type_matches_integers_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..319b5f01aa5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.IntSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_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_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py index 67a617da01e..fe02b0ea2c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_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_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..bafaf77411c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_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_invalid_string_value_for_default_response_body_for_content_types/post.py index 030132face7..ed8fd5d7dd4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_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_invalid_string_value_for_default_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..95b62e3e3d6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = InvalidStringValueForDefault diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_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_ipv4_format_response_body_for_content_types/post.py index c06d2d26263..57487e7d555 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_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_ipv4_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_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_ipv6_format_response_body_for_content_types/post.py index abb092fc8a5..903f7cd00f9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_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_ipv6_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_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_json_pointer_format_response_body_for_content_types/post.py index 77f8c42fb27..08b3e84388f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_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_json_pointer_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_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_maximum_validation_response_body_for_content_types/post.py index ce70ca87c9f..f9536ba3422 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_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_maximum_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..ec70f799e64 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MaximumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_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_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py index 170aebf7d30..15437c362bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_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_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..adf492fc50a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MaximumValidationWithUnsignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_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_maxitems_validation_response_body_for_content_types/post.py index 87f3f5cd44c..a947b9ecae3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_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_maxitems_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..5308fc6ae7f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MaxitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_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_maxlength_validation_response_body_for_content_types/post.py index 01fa683ca01..4cd9deebe3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_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_maxlength_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..1cbde7b04c9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MaxlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_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_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py index a2cfe48bdae..7cf33c9a085 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_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_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..f11908cec36 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_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_maxproperties_validation_response_body_for_content_types/post.py index 041f8101e71..c95f9cfc327 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_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_maxproperties_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..fef953fbb91 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MaxpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_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_minimum_validation_response_body_for_content_types/post.py index d99f6970d3e..92b764fab5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_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_minimum_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..3cfb03ff52c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MinimumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_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_minimum_validation_with_signed_integer_response_body_for_content_types/post.py index 74b3d24ddaa..ad52bc48903 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_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_minimum_validation_with_signed_integer_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..f244ba2d752 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MinimumValidationWithSignedInteger diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_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_minitems_validation_response_body_for_content_types/post.py index 976a8f6678c..c098da8ef90 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_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_minitems_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..5f220b19f9f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MinitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_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_minlength_validation_response_body_for_content_types/post.py index 9ff010f6a6c..c6b6751eb7f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_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_minlength_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..dfe830e3188 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MinlengthValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_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_minproperties_validation_response_body_for_content_types/post.py index 9f978dbd328..e35434f8820 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_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_minproperties_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..cc454fdd550 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = MinpropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_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_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py index 9ffe67946f5..cf50ab35633 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_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_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..1b112569505 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = NestedAllofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_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_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py index 4e282bbc418..c8a71c8d4b0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_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_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7fe62fc8ab2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = NestedAnyofToCheckValidationSemantics diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_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_nested_items_response_body_for_content_types/post.py index 059e752df1f..9c64a6527c7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_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_nested_items_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..a0d4337b929 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = NestedItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_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_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py index eae7bbfb476..06e90801755 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_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_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..15f5f0d0079 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = NestedOneofToCheckValidationSemantics 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 a96f8e87054..f365edb0271 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -43,16 +44,26 @@ class SchemaFor200ResponseBodyApplicationJson( class MetaOapg: class properties: foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } additional_properties = schemas.AnyTypeSchema foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'not_schema': return super().__new__( cls, @@ -62,12 +73,16 @@ class SchemaFor200ResponseBodyApplicationJson( **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, 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.pyi 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.pyi new file mode 100644 index 00000000000..908730b162f --- /dev/null +++ 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.pyi @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class not_schema( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + foo = schemas.StrSchema + __annotations__ = { + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'not_schema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 fd35fa873a4..155cf705d9c 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -35,12 +36,16 @@ class SchemaFor200ResponseBodyApplicationJson( additional_properties = schemas.AnyTypeSchema not_schema = schemas.IntSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, 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.pyi 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.pyi new file mode 100644 index 00000000000..8d38820866c --- /dev/null +++ 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.pyi @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.IntSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_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_nul_characters_in_strings_response_body_for_content_types/post.py index b90cd41500a..0afec139d86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_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_nul_characters_in_strings_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..0eb3eed7930 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = NulCharactersInStrings diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_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_null_type_matches_only_the_null_object_response_body_for_content_types/post.py index 0a9b98c1353..072517fd32d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_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_null_type_matches_only_the_null_object_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..c67d95fbd5b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.NoneSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_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_number_type_matches_numbers_response_body_for_content_types/post.py index d79fde53435..0f2a9ed0b4f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_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_number_type_matches_numbers_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..0b4ea10d989 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.NumberSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_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_object_properties_validation_response_body_for_content_types/post.py index fd41aa9315b..7d07d8812f8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_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_object_properties_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..72ea610a8b1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = ObjectPropertiesValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_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_object_type_matches_objects_response_body_for_content_types/post.py index ad9e488a2f9..728887b3028 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_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_object_type_matches_objects_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..07509d7390d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_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_oneof_complex_types_response_body_for_content_types/post.py index fdd1f2c8df1..8b614b5c6bc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_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_oneof_complex_types_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..cf05ea455ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = OneofComplexTypes diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_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_oneof_response_body_for_content_types/post.py index 20b81af2870..396a94f1fdb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_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_oneof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..cafcc96553d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = Oneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_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_oneof_with_base_schema_response_body_for_content_types/post.py index a88d859ce89..42f3204d85b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_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_oneof_with_base_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..8c39e0fb84a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = OneofWithBaseSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_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_oneof_with_empty_schema_response_body_for_content_types/post.py index 30fdb0923b0..467025d65c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_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_oneof_with_empty_schema_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..f217419d54b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = OneofWithEmptySchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_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_oneof_with_required_response_body_for_content_types/post.py index 76cd9b78c5a..500ab14a036 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_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_oneof_with_required_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..c91c548451c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = OneofWithRequired diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_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_pattern_is_not_anchored_response_body_for_content_types/post.py index 52c32db7cb1..c50189eeae9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_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_pattern_is_not_anchored_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..6aef59649d7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = PatternIsNotAnchored diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_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_pattern_validation_response_body_for_content_types/post.py index 6b754672cea..ec56f0a1e03 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_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_pattern_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..1303d186f03 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = PatternValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_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_properties_with_escaped_characters_response_body_for_content_types/post.py index 6d65f9cb8b0..4e675c16669 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_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_properties_with_escaped_characters_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..a2e64455f6d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = PropertiesWithEscapedCharacters diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_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_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py index 9fc934c8ebb..193c37d8f47 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_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_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..34d4f030419 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = PropertyNamedRefThatIsNotAReference diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_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_ref_in_additionalproperties_response_body_for_content_types/post.py index 21064d14c55..b7f1368a836 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_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_ref_in_additionalproperties_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..9f71dfab725 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInAdditionalproperties diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_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_ref_in_allof_response_body_for_content_types/post.py index c893918c417..46cdd3f1a68 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_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_ref_in_allof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..17b409ae0ff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInAllof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_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_ref_in_anyof_response_body_for_content_types/post.py index 8bdfab1f280..6993fe75024 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_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_ref_in_anyof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..88c8be90def --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInAnyof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_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_ref_in_items_response_body_for_content_types/post.py index a21654772b0..2f062c90d2f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_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_ref_in_items_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..d1c3bad1d1e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInItems diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_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_ref_in_not_response_body_for_content_types/post.py index d88ea891fe9..429eea37ee3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_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_ref_in_not_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 @@ -41,12 +42,16 @@ class SchemaFor200ResponseBodyApplicationJson( def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: return PropertyNamedRefThatIsNotAReference + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..c70ceaabdfa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']: + return PropertyNamedRefThatIsNotAReference + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_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_ref_in_oneof_response_body_for_content_types/post.py index a8324a53ece..44bffce6837 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_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_ref_in_oneof_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..e16b94f180f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInOneof diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_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_ref_in_property_response_body_for_content_types/post.py index 1e9e9a6004e..b3cf6a0a9a6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_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_ref_in_property_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..87c9ef6c36f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RefInProperty diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_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_required_default_validation_response_body_for_content_types/post.py index e54b5ac4956..e4f805214f8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_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_required_default_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..5583293adc3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RequiredDefaultValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_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_required_validation_response_body_for_content_types/post.py index 2a443441f27..7106ad68646 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_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_required_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..26fde5e3b9a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RequiredValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_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_required_with_empty_array_response_body_for_content_types/post.py index e5468bf082e..b6c385653cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_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_required_with_empty_array_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..1615021a812 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = RequiredWithEmptyArray diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_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_required_with_escaped_characters_response_body_for_content_types/post.py index d26e7933993..e0485457b5c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_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_required_with_escaped_characters_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path @@ -43,12 +44,34 @@ class SchemaFor200ResponseBodyApplicationJson( additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..5f4c477a24b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.AnyTypeSchema, +): + + + class MetaOapg: + required = { + "foo\"bar", + "foo\nbar", + "foo\fbar", + "foo\tbar", + "foo\rbar", + "foo\\bar", + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\"bar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\nbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\fbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\tbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\rbar"]) -> MetaOapg.additional_properties: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo\\\\bar"]) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_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_simple_enum_validation_response_body_for_content_types/post.py index 5f44bebad07..e97a8c0d4d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_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_simple_enum_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..a6e96a3200d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = SimpleEnumValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_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_string_type_matches_strings_response_body_for_content_types/post.py index b0bb162eabb..45097eddd5e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_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_string_type_matches_strings_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..48a479ec455 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_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_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py index 7af44dc91e6..f86e000b9ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_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_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..7617fedfcd5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_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_uniqueitems_false_validation_response_body_for_content_types/post.py index 39c7df5dd0f..c20bcafdce0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_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_uniqueitems_false_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..120ab8965c0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = UniqueitemsFalseValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_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_uniqueitems_validation_response_body_for_content_types/post.py index ae8772b47eb..aa463135a4f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_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_uniqueitems_validation_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..f4c183b4664 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +SchemaFor200ResponseBodyApplicationJson = UniqueitemsValidation diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_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_uri_format_response_body_for_content_types/post.py index 5b50e4ab903..550aeea6fd3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_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_uri_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_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_uri_reference_format_response_body_for_content_types/post.py index bc97b3f37ca..6404500b4ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_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_uri_reference_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_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_uri_template_format_response_body_for_content_types/post.py index a4e00c7d6a1..0c7579f4506 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_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_uri_template_format_response_body_for_content_types/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from unit_test_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from unit_test_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi new file mode 100644 index 00000000000..540e70a35e8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from unit_test_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from unit_test_api import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema 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 6f146a5da3b..b200829bbfc 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 @@ -19,7 +19,7 @@ import typing import uuid from dateutil.parser.isoparser import isoparser, _takes_ascii -from frozendict import frozendict +import frozendict from unit_test_api.exceptions import ( ApiTypeError, @@ -79,7 +79,7 @@ def update(d: dict, u: dict): d[k] = d[k] | v -class ValidationMetadata(frozendict): +class ValidationMetadata(frozendict.frozendict): """ A class storing metadata that is needed to validate OpenApi Schema payloads """ @@ -89,7 +89,7 @@ class ValidationMetadata(frozendict): from_server: bool = False, configuration: typing.Optional[Configuration] = None, seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict() + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() ): """ Args: @@ -244,7 +244,7 @@ class Schema: """ the base class of all swagger/openapi schemas/models """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict, FileIO, bytes, BoolClass, NoneClass} + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} MetaOapg = MetaOapgTyped @classmethod @@ -252,7 +252,7 @@ class Schema: cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ Schema _validate Runs all schema validation logic and @@ -263,7 +263,7 @@ class Schema: - the returned instance is a serializable type (except for None, True, and False) which are enums Use cases: - 1. inheritable type: string/decimal.Decimal/frozendict/tuple + 1. inheritable type: string/decimal.Decimal/frozendict.frozendict/tuple 2. singletons: bool/None -> uses the base classes BoolClass/NoneClass Required Steps: @@ -286,7 +286,7 @@ class Schema: @staticmethod def __process_schema_classes( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]] + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] ): """ Processes and mutates schema_classes @@ -339,11 +339,11 @@ class Schema: for path, schema_classes in _path_to_schemas.items(): """ Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict/str/Decimal/bytes/FileIo + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo needs Singleton added 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict/str/Decimal/bytes/FileIo + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo """ cls.__process_schema_classes(schema_classes) enum_schema = any( @@ -368,7 +368,7 @@ class Schema: path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict): + if issubclass(cls, frozendict.frozendict): properties = cls._get_properties(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, properties) elif issubclass(cls, tuple): @@ -396,7 +396,7 @@ class Schema: None, 'Schema', dict, - frozendict, + frozendict.frozendict, tuple, list, io.FileIO, @@ -423,25 +423,25 @@ class Schema: return new_inst @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict: + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: input_dict = {} - if args and isinstance(args[0], (dict, frozendict)): + if args and isinstance(args[0], (dict, frozendict.frozendict)): input_dict.update(args[0]) if kwargs: input_dict.update(kwargs) - return frozendict(input_dict) + return frozendict.frozendict(input_dict) @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: - args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values _configuration: contains the Configuration that enables json schema validation keywords like minItems, minLength etc """ @@ -471,10 +471,10 @@ class Schema: def __init__( self, *args: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] ): """ @@ -538,7 +538,7 @@ class Validator(typing.Protocol): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: pass @@ -610,7 +610,7 @@ def SchemaTypeCheckerClsFactory(union_type_cls: typing.Union[typing.Any]) -> Val cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaTypeChecker _validate Validates arg's type @@ -661,7 +661,7 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaEnumMaker _validate Validates that arg is in the enum's allowed values @@ -784,7 +784,7 @@ class StrBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ StrBase _validate Validates that validations pass @@ -1068,7 +1068,7 @@ class NumberBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ NumberBase _validate Validates that validations pass @@ -1301,10 +1301,12 @@ class DictBase(Discriminable, ValidatorBase): invalid_arguments = [] required_property_names = getattr(cls.MetaOapg, 'required', set()) additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name in arg: if property_name in required_property_names: seen_required_properties.add(property_name) - elif property_name in cls._property_names: + elif property_name in property_annotations: continue elif additional_properties: continue @@ -1348,15 +1350,20 @@ class DictBase(Discriminable, ValidatorBase): """ path_to_schemas = {} additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name, value in arg.items(): - if property_name in cls._property_names: - schema = getattr(cls.MetaOapg.properties, property_name) + if property_name in property_annotations: + schema = property_annotations[property_name] elif additional_properties: schema = additional_properties else: raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( value, cls, validation_metadata.path_to_item+(property_name,) )) + if isinstance(schema, classmethod): + # referenced schema, call classmethod property + schema = schema.__func__.fget(properties) arg_validation_metadata = ValidationMetadata( from_server=validation_metadata.from_server, configuration=validation_metadata.configuration, @@ -1418,10 +1425,10 @@ class DictBase(Discriminable, ValidatorBase): ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if isinstance(arg, frozendict): + if isinstance(arg, frozendict.frozendict): cls.__check_dict_validations(arg, validation_metadata) _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict): + if not isinstance(arg, frozendict.frozendict): return _path_to_schemas cls._validate_arg_presence(arg) other_path_to_schemas = cls._validate_args(arg, validation_metadata=validation_metadata) @@ -1457,30 +1464,6 @@ class DictBase(Discriminable, ValidatorBase): update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas - @classmethod - @property - @functools.cache - def _property_names(cls) -> typing.Tuple[str]: - if not hasattr(cls.MetaOapg, 'properties'): - return tuple() - property_names = set() - for var_name, var_value in cls.MetaOapg.properties.__dict__.items(): - var_name: str - # referenced models are classmethods - is_classmethod = type(var_value) is classmethod - if is_classmethod: - property_names.add(var_name) - continue - is_class = type(var_value) is type - if not is_class: - continue - if not issubclass(var_value, Schema): - continue - property_names.add(var_name) - property_names = list(property_names) - property_names.sort() - return tuple(property_names) - @classmethod def _get_properties( cls, @@ -1525,7 +1508,7 @@ class DictBase(Discriminable, ValidatorBase): def __getattr__(self, name: str): # for instance.name access - if isinstance(self, frozendict): + if isinstance(self, frozendict.frozendict): # if an attribute does not exist try: return self[name] @@ -1535,11 +1518,11 @@ class DictBase(Discriminable, ValidatorBase): def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema], + arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema], from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]], + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: +) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: """ Casts the input payload arg into the allowed types The input validated_path_to_schemas is mutated by running this function @@ -1571,8 +1554,8 @@ def cast_to_allowed_types( if isinstance(arg, str): return str(arg) - elif isinstance(arg, (dict, frozendict)): - return frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) + elif isinstance(arg, (dict, frozendict.frozendict)): + return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) elif isinstance(arg, (bool, BoolClass)): """ this check must come before isinstance(arg, (int, float)) @@ -1694,7 +1677,7 @@ class ComposedBase(Discriminable): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ ComposedBase _validate We return dynamic classes of different bases depending upon the inputs @@ -1724,7 +1707,7 @@ class ComposedBase(Discriminable): # process composed schema discriminator = getattr(cls, 'discriminator', None) discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict): + if discriminator and arg and isinstance(arg, frozendict.frozendict): disc_property_name = list(discriminator.keys())[0] cls._ensure_discriminator_value_present(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class @@ -1788,7 +1771,7 @@ class ComposedBase(Discriminable): # DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase class ComposedSchema( - SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict.frozendict]), ComposedBase, DictBase, ListBase, @@ -2093,7 +2076,7 @@ class BoolSchema( class AnyTypeSchema( SchemaTypeCheckerClsFactory( - typing.Union[frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] + typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] ), DictBase, ListBase, @@ -2107,7 +2090,7 @@ class AnyTypeSchema( class DictSchema( - SchemaTypeCheckerClsFactory(typing.Union[frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict]), DictBase, Schema, FrozenDictMixin @@ -2116,11 +2099,11 @@ class DictSchema( def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *args, **kwargs) -schema_type_classes = set([NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema]) +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema} @functools.cache diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index ed8b938cca5..6a8feb27ea9 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -135,116 +135,227 @@ petstore_api/configuration.py petstore_api/exceptions.py petstore_api/model/__init__.py petstore_api/model/additional_properties_class.py +petstore_api/model/additional_properties_class.pyi petstore_api/model/additional_properties_with_array_of_enums.py +petstore_api/model/additional_properties_with_array_of_enums.pyi petstore_api/model/address.py +petstore_api/model/address.pyi petstore_api/model/animal.py +petstore_api/model/animal.pyi petstore_api/model/animal_farm.py +petstore_api/model/animal_farm.pyi petstore_api/model/any_type_not_string.py +petstore_api/model/any_type_not_string.pyi petstore_api/model/api_response.py +petstore_api/model/api_response.pyi petstore_api/model/apple.py +petstore_api/model/apple.pyi petstore_api/model/apple_req.py +petstore_api/model/apple_req.pyi petstore_api/model/array_holding_any_type.py +petstore_api/model/array_holding_any_type.pyi petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_array_of_number_only.pyi petstore_api/model/array_of_enums.py +petstore_api/model/array_of_enums.pyi petstore_api/model/array_of_number_only.py +petstore_api/model/array_of_number_only.pyi petstore_api/model/array_test.py +petstore_api/model/array_test.pyi petstore_api/model/array_with_validations_in_items.py +petstore_api/model/array_with_validations_in_items.pyi petstore_api/model/banana.py +petstore_api/model/banana.pyi petstore_api/model/banana_req.py +petstore_api/model/banana_req.pyi petstore_api/model/bar.py +petstore_api/model/bar.pyi petstore_api/model/basque_pig.py +petstore_api/model/basque_pig.pyi petstore_api/model/boolean.py +petstore_api/model/boolean.pyi petstore_api/model/boolean_enum.py +petstore_api/model/boolean_enum.pyi petstore_api/model/capitalization.py +petstore_api/model/capitalization.pyi petstore_api/model/cat.py +petstore_api/model/cat.pyi petstore_api/model/category.py +petstore_api/model/category.pyi petstore_api/model/child_cat.py +petstore_api/model/child_cat.pyi petstore_api/model/class_model.py +petstore_api/model/class_model.pyi petstore_api/model/client.py +petstore_api/model/client.pyi petstore_api/model/complex_quadrilateral.py +petstore_api/model/complex_quadrilateral.pyi petstore_api/model/composed_any_of_different_types_no_validations.py +petstore_api/model/composed_any_of_different_types_no_validations.pyi petstore_api/model/composed_array.py +petstore_api/model/composed_array.pyi petstore_api/model/composed_bool.py +petstore_api/model/composed_bool.pyi petstore_api/model/composed_none.py +petstore_api/model/composed_none.pyi petstore_api/model/composed_number.py +petstore_api/model/composed_number.pyi petstore_api/model/composed_object.py +petstore_api/model/composed_object.pyi petstore_api/model/composed_one_of_different_types.py +petstore_api/model/composed_one_of_different_types.pyi petstore_api/model/composed_string.py +petstore_api/model/composed_string.pyi petstore_api/model/currency.py +petstore_api/model/currency.pyi petstore_api/model/danish_pig.py +petstore_api/model/danish_pig.pyi petstore_api/model/date_time_test.py +petstore_api/model/date_time_test.pyi petstore_api/model/date_time_with_validations.py +petstore_api/model/date_time_with_validations.pyi petstore_api/model/date_with_validations.py +petstore_api/model/date_with_validations.pyi petstore_api/model/decimal_payload.py +petstore_api/model/decimal_payload.pyi petstore_api/model/dog.py +petstore_api/model/dog.pyi petstore_api/model/drawing.py +petstore_api/model/drawing.pyi petstore_api/model/enum_arrays.py +petstore_api/model/enum_arrays.pyi petstore_api/model/enum_class.py +petstore_api/model/enum_class.pyi petstore_api/model/enum_test.py +petstore_api/model/enum_test.pyi petstore_api/model/equilateral_triangle.py +petstore_api/model/equilateral_triangle.pyi petstore_api/model/file.py +petstore_api/model/file.pyi petstore_api/model/file_schema_test_class.py +petstore_api/model/file_schema_test_class.pyi petstore_api/model/foo.py +petstore_api/model/foo.pyi petstore_api/model/format_test.py +petstore_api/model/format_test.pyi petstore_api/model/fruit.py +petstore_api/model/fruit.pyi petstore_api/model/fruit_req.py +petstore_api/model/fruit_req.pyi petstore_api/model/gm_fruit.py +petstore_api/model/gm_fruit.pyi petstore_api/model/grandparent_animal.py +petstore_api/model/grandparent_animal.pyi petstore_api/model/has_only_read_only.py +petstore_api/model/has_only_read_only.pyi petstore_api/model/health_check_result.py +petstore_api/model/health_check_result.pyi petstore_api/model/integer_enum.py +petstore_api/model/integer_enum.pyi petstore_api/model/integer_enum_big.py +petstore_api/model/integer_enum_big.pyi petstore_api/model/integer_enum_one_value.py +petstore_api/model/integer_enum_one_value.pyi petstore_api/model/integer_enum_with_default_value.py +petstore_api/model/integer_enum_with_default_value.pyi petstore_api/model/integer_max10.py +petstore_api/model/integer_max10.pyi petstore_api/model/integer_min15.py +petstore_api/model/integer_min15.pyi petstore_api/model/isosceles_triangle.py +petstore_api/model/isosceles_triangle.pyi petstore_api/model/mammal.py +petstore_api/model/mammal.pyi petstore_api/model/map_test.py +petstore_api/model/map_test.pyi petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/mixed_properties_and_additional_properties_class.pyi petstore_api/model/model200_response.py +petstore_api/model/model200_response.pyi petstore_api/model/model_return.py +petstore_api/model/model_return.pyi petstore_api/model/money.py +petstore_api/model/money.pyi petstore_api/model/name.py +petstore_api/model/name.pyi petstore_api/model/no_additional_properties.py +petstore_api/model/no_additional_properties.pyi petstore_api/model/nullable_class.py +petstore_api/model/nullable_class.pyi petstore_api/model/nullable_shape.py +petstore_api/model/nullable_shape.pyi petstore_api/model/nullable_string.py +petstore_api/model/nullable_string.pyi petstore_api/model/number.py +petstore_api/model/number.pyi petstore_api/model/number_only.py +petstore_api/model/number_only.pyi petstore_api/model/number_with_validations.py +petstore_api/model/number_with_validations.pyi petstore_api/model/object_interface.py +petstore_api/model/object_interface.pyi petstore_api/model/object_model_with_ref_props.py +petstore_api/model/object_model_with_ref_props.pyi petstore_api/model/object_with_decimal_properties.py +petstore_api/model/object_with_decimal_properties.pyi petstore_api/model/object_with_difficultly_named_props.py +petstore_api/model/object_with_difficultly_named_props.pyi petstore_api/model/object_with_inline_composition_property.py +petstore_api/model/object_with_inline_composition_property.pyi petstore_api/model/object_with_validations.py +petstore_api/model/object_with_validations.pyi petstore_api/model/order.py +petstore_api/model/order.pyi petstore_api/model/parent_pet.py +petstore_api/model/parent_pet.pyi petstore_api/model/pet.py +petstore_api/model/pet.pyi petstore_api/model/pig.py +petstore_api/model/pig.pyi petstore_api/model/player.py +petstore_api/model/player.pyi petstore_api/model/quadrilateral.py +petstore_api/model/quadrilateral.pyi petstore_api/model/quadrilateral_interface.py +petstore_api/model/quadrilateral_interface.pyi petstore_api/model/read_only_first.py +petstore_api/model/read_only_first.pyi petstore_api/model/scalene_triangle.py +petstore_api/model/scalene_triangle.pyi petstore_api/model/shape.py +petstore_api/model/shape.pyi petstore_api/model/shape_or_null.py +petstore_api/model/shape_or_null.pyi petstore_api/model/simple_quadrilateral.py +petstore_api/model/simple_quadrilateral.pyi petstore_api/model/some_object.py +petstore_api/model/some_object.pyi petstore_api/model/special_model_name.py +petstore_api/model/special_model_name.pyi petstore_api/model/string.py +petstore_api/model/string.pyi petstore_api/model/string_boolean_map.py +petstore_api/model/string_boolean_map.pyi petstore_api/model/string_enum.py +petstore_api/model/string_enum.pyi petstore_api/model/string_enum_with_default_value.py +petstore_api/model/string_enum_with_default_value.pyi petstore_api/model/string_with_validation.py +petstore_api/model/string_with_validation.pyi petstore_api/model/tag.py +petstore_api/model/tag.pyi petstore_api/model/triangle.py +petstore_api/model/triangle.pyi petstore_api/model/triangle_interface.py +petstore_api/model/triangle_interface.pyi petstore_api/model/user.py +petstore_api/model/user.pyi petstore_api/model/uuid_string.py +petstore_api/model/uuid_string.pyi petstore_api/model/whale.py +petstore_api/model/whale.pyi petstore_api/model/zebra.py +petstore_api/model/zebra.pyi petstore_api/models/__init__.py petstore_api/rest.py petstore_api/schemas.py 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 3afd47b60cf..64a7bfd4e90 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 @@ -25,6 +25,7 @@ from urllib3._collections import HTTPHeaderDict from urllib.parse import quote from urllib3.fields import RequestField as RequestFieldBase +import frozendict from petstore_api import rest from petstore_api.configuration import Configuration @@ -38,7 +39,6 @@ from petstore_api.schemas import ( date, datetime, none_type, - frozendict, Unset, unset, ) @@ -67,7 +67,7 @@ class JSONEncoder(json.JSONEncoder): return None elif isinstance(obj, BoolClass): return bool(obj) - elif isinstance(obj, (dict, frozendict)): + elif isinstance(obj, (dict, frozendict.frozendict)): return {key: self.default(val) for key, val in obj.items()} elif isinstance(obj, (list, tuple)): return [self.default(item) for item in obj] @@ -478,7 +478,7 @@ class PathParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -596,7 +596,7 @@ class QueryParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict], + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: if self.schema: @@ -662,7 +662,7 @@ class CookieParameter(ParameterBase, StyleFormSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -734,7 +734,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer): def serialize( self, in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict[str, str]: if self.schema: cast_in_data = self.schema(in_data) @@ -1368,8 +1368,8 @@ class RequestBody(StyleFormSerializer, JSONDetector): @staticmethod def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict): - raise ValueError('Unable to serialize type frozendict to text/plain') + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') elif isinstance(in_data, tuple): raise ValueError('Unable to serialize type tuple to text/plain') elif isinstance(in_data, NoneClass): @@ -1402,7 +1402,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): def __serialize_multipart_form_data( self, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') """ In a multipart/form-data request body, each schema property, or each element of a schema array property, @@ -1449,7 +1449,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): """ POST submission of form data in body """ - if not isinstance(in_data, frozendict): + if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) @@ -1471,7 +1471,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): media_type = self.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict)) and in_data: + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: cast_in_data = media_type.schema(**in_data) else: cast_in_data = media_type.schema(in_data) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index 8c6d5a42c17..d031b32078c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -45,10 +43,14 @@ class AdditionalPropertiesClass( class MetaOapg: additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'map_property': @@ -75,10 +77,14 @@ class AdditionalPropertiesClass( class MetaOapg: additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'additional_properties': @@ -88,12 +94,16 @@ class AdditionalPropertiesClass( _configuration=_configuration, **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], ) -> 'map_of_map_property': return super().__new__( cls, @@ -117,7 +127,7 @@ class AdditionalPropertiesClass( def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'empty_map': return super().__new__( @@ -134,10 +144,14 @@ class AdditionalPropertiesClass( class MetaOapg: additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'map_with_undeclared_properties_string': @@ -147,6 +161,16 @@ class AdditionalPropertiesClass( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "map_property": map_property, + "map_of_map_property": map_of_map_property, + "anytype_1": anytype_1, + "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, + "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, + "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, + "empty_map": empty_map, + "map_with_undeclared_properties_string": map_with_undeclared_properties_string, + } additional_properties = schemas.AnyTypeSchema map_property: MetaOapg.properties.map_property @@ -157,20 +181,48 @@ class AdditionalPropertiesClass( map_with_undeclared_properties_anytype_3: MetaOapg.properties.map_with_undeclared_properties_anytype_3 empty_map: MetaOapg.properties.empty_map map_with_undeclared_properties_string: MetaOapg.properties.map_with_undeclared_properties_string + + @typing.overload + def __getitem__(self, name: typing.Literal["map_property"]) -> MetaOapg.properties.map_property: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict, schemas.Unset] = schemas.unset, - map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict, schemas.Unset] = schemas.unset, - anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict, schemas.Unset] = schemas.unset, - empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AdditionalPropertiesClass': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi new file mode 100644 index 00000000000..d031b32078c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AdditionalPropertiesClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class map_property( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_property': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class map_of_map_property( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'map_of_map_property': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + anytype_1 = schemas.AnyTypeSchema + map_with_undeclared_properties_anytype_1 = schemas.DictSchema + map_with_undeclared_properties_anytype_2 = schemas.DictSchema + map_with_undeclared_properties_anytype_3 = schemas.DictSchema + + + class empty_map( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = None + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'empty_map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class map_with_undeclared_properties_string( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_with_undeclared_properties_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "map_property": map_property, + "map_of_map_property": map_of_map_property, + "anytype_1": anytype_1, + "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, + "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, + "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, + "empty_map": empty_map, + "map_with_undeclared_properties_string": map_with_undeclared_properties_string, + } + additional_properties = schemas.AnyTypeSchema + + map_property: MetaOapg.properties.map_property + map_of_map_property: MetaOapg.properties.map_of_map_property + anytype_1: MetaOapg.properties.anytype_1 + map_with_undeclared_properties_anytype_1: MetaOapg.properties.map_with_undeclared_properties_anytype_1 + map_with_undeclared_properties_anytype_2: MetaOapg.properties.map_with_undeclared_properties_anytype_2 + map_with_undeclared_properties_anytype_3: MetaOapg.properties.map_with_undeclared_properties_anytype_3 + empty_map: MetaOapg.properties.empty_map + map_with_undeclared_properties_string: MetaOapg.properties.map_with_undeclared_properties_string + + @typing.overload + def __getitem__(self, name: typing.Literal["map_property"]) -> MetaOapg.properties.map_property: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AdditionalPropertiesClass': + return super().__new__( + cls, + *args, + map_property=map_property, + map_of_map_property=map_of_map_property, + anytype_1=anytype_1, + map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, + map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, + map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, + empty_map=empty_map, + map_with_undeclared_properties_string=map_with_undeclared_properties_string, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 4d139f0f038..0fcfbe2bab4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,12 +58,16 @@ class AdditionalPropertiesWithArrayOfEnums( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'EnumClass': return super().__getitem__(i) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, tuple, ], ) -> 'AdditionalPropertiesWithArrayOfEnums': diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi new file mode 100644 index 00000000000..0fcfbe2bab4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AdditionalPropertiesWithArrayOfEnums( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class additional_properties( + schemas.ListSchema + ): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['EnumClass']: + return EnumClass + + def __new__( + cls, + arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'additional_properties': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'EnumClass': + return super().__getitem__(i) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, tuple, ], + ) -> 'AdditionalPropertiesWithArrayOfEnums': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 1461fca491e..567fe27c808 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -36,10 +34,14 @@ class Address( class MetaOapg: additional_properties = schemas.IntSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, int, ], ) -> 'Address': diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi new file mode 100644 index 00000000000..567fe27c808 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Address( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.IntSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, int, ], + ) -> 'Address': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index dcae88b4a16..7b37f3af892 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -51,18 +49,32 @@ class Animal( class properties: className = schemas.StrSchema color = schemas.StrSchema + __annotations__ = { + "className": className, + "color": color, + } additional_properties = schemas.AnyTypeSchema className: MetaOapg.properties.className color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], className: typing.Union[MetaOapg.properties.className, str, ], color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Animal': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi new file mode 100644 index 00000000000..7b37f3af892 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Animal( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "className", + } + + @classmethod + @property + def discriminator(cls): + return { + 'className': { + 'Cat': Cat, + 'Dog': Dog, + } + } + class properties: + className = schemas.StrSchema + color = schemas.StrSchema + __annotations__ = { + "className": className, + "color": color, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Animal': + return super().__new__( + cls, + *args, + className=className, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.cat import Cat +from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 7c1606e99a1..9398649ff88 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -52,7 +50,7 @@ class AnimalFarm( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Animal': return super().__getitem__(i) from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi new file mode 100644 index 00000000000..9398649ff88 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AnimalFarm( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Animal']: + return Animal + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'AnimalFarm': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Animal': + return super().__getitem__(i) + +from petstore_api.model.animal import Animal 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 e8e1f3b0bb7..5ec1425ae8c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -38,12 +36,16 @@ class AnyTypeNotString( additional_properties = schemas.AnyTypeSchema not_schema = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'AnyTypeNotString': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi new file mode 100644 index 00000000000..5ec1425ae8c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AnyTypeNotString( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.StrSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'AnyTypeNotString': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index a1d196a253e..9ecef0613b6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,20 +37,38 @@ class ApiResponse( code = schemas.Int32Schema type = schemas.StrSchema message = schemas.StrSchema + __annotations__ = { + "code": code, + "type": type, + "message": message, + } additional_properties = schemas.AnyTypeSchema code: MetaOapg.properties.code type: MetaOapg.properties.type message: MetaOapg.properties.message + + @typing.overload + def __getitem__(self, name: typing.Literal["code"]) -> MetaOapg.properties.code: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["type"]) -> MetaOapg.properties.type: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["message"]) -> MetaOapg.properties.message: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], code: typing.Union[MetaOapg.properties.code, int, schemas.Unset] = schemas.unset, type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ApiResponse': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi new file mode 100644 index 00000000000..9ecef0613b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ApiResponse( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + code = schemas.Int32Schema + type = schemas.StrSchema + message = schemas.StrSchema + __annotations__ = { + "code": code, + "type": type, + "message": message, + } + additional_properties = schemas.AnyTypeSchema + + code: MetaOapg.properties.code + type: MetaOapg.properties.type + message: MetaOapg.properties.message + + @typing.overload + def __getitem__(self, name: typing.Literal["code"]) -> MetaOapg.properties.code: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["type"]) -> MetaOapg.properties.type: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["message"]) -> MetaOapg.properties.message: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + code: typing.Union[MetaOapg.properties.code, int, schemas.Unset] = schemas.unset, + type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, + message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ApiResponse': + return super().__new__( + cls, + *args, + code=code, + type=type, + message=message, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index b4060a48668..d1647a5b0e6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -10,22 +10,20 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 class Apple( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -67,18 +65,32 @@ class Apple( re.IGNORECASE ) }] + __annotations__ = { + "cultivar": cultivar, + "origin": origin, + } additional_properties = schemas.AnyTypeSchema cultivar: MetaOapg.properties.cultivar origin: MetaOapg.properties.origin + + @typing.overload + def __getitem__(self, name: typing.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["origin"]) -> MetaOapg.properties.origin: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Apple': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi new file mode 100644 index 00000000000..37f5df154fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Apple( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "cultivar", + } + class properties: + + + class cultivar( + schemas.StrSchema + ): + pass + + + class origin( + schemas.StrSchema + ): + pass + __annotations__ = { + "cultivar": cultivar, + "origin": origin, + } + additional_properties = schemas.AnyTypeSchema + + + cultivar: MetaOapg.properties.cultivar + origin: MetaOapg.properties.origin + + @typing.overload + def __getitem__(self, name: typing.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["origin"]) -> MetaOapg.properties.origin: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Apple': + return super().__new__( + cls, + *args, + origin=origin, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 62cb92b24b6..d5284aac246 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,14 +39,26 @@ class AppleReq( class properties: cultivar = schemas.StrSchema mealy = schemas.BoolSchema + __annotations__ = { + "cultivar": cultivar, + "mealy": mealy, + } additional_properties = None cultivar: MetaOapg.properties.cultivar mealy: MetaOapg.properties.mealy + + @typing.overload + def __getitem__(self, name: typing.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + def __getitem__(self, name: typing.Literal["mealy"]) -> MetaOapg.properties.mealy: + # dict_instance[name] accessor + return super().__getitem__(name) + def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi new file mode 100644 index 00000000000..d5284aac246 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class AppleReq( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "cultivar", + } + class properties: + cultivar = schemas.StrSchema + mealy = schemas.BoolSchema + __annotations__ = { + "cultivar": cultivar, + "mealy": mealy, + } + additional_properties = None + + cultivar: MetaOapg.properties.cultivar + mealy: MetaOapg.properties.mealy + + @typing.overload + def __getitem__(self, name: typing.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + def __getitem__(self, name: typing.Literal["mealy"]) -> MetaOapg.properties.mealy: + # dict_instance[name] accessor + return super().__getitem__(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], + mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'AppleReq': + return super().__new__( + cls, + *args, + cultivar=cultivar, + mealy=mealy, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py index a0cffcdd22d..858354e6b0e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,7 +37,7 @@ class ArrayHoldingAnyType( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'ArrayHoldingAnyType': return super().__new__( @@ -48,5 +46,5 @@ class ArrayHoldingAnyType( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi new file mode 100644 index 00000000000..858354e6b0e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayHoldingAnyType( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + items = schemas.AnyTypeSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayHoldingAnyType': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index a9f11f1b18b..ebdd7a990f8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -65,7 +63,7 @@ class ArrayOfArrayOfNumberOnly( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) def __new__( @@ -79,18 +77,28 @@ class ArrayOfArrayOfNumberOnly( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + __annotations__ = { + "ArrayArrayNumber": ArrayArrayNumber, + } additional_properties = schemas.AnyTypeSchema ArrayArrayNumber: MetaOapg.properties.ArrayArrayNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ArrayOfArrayOfNumberOnly': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi new file mode 100644 index 00000000000..ebdd7a990f8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfArrayOfNumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class ArrayArrayNumber( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayArrayNumber': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "ArrayArrayNumber": ArrayArrayNumber, + } + additional_properties = schemas.AnyTypeSchema + + ArrayArrayNumber: MetaOapg.properties.ArrayArrayNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ArrayOfArrayOfNumberOnly': + return super().__new__( + cls, + *args, + ArrayArrayNumber=ArrayArrayNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 98fc48db7b7..952b2f9737f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -52,7 +50,7 @@ class ArrayOfEnums( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'StringEnum': return super().__getitem__(i) from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi new file mode 100644 index 00000000000..952b2f9737f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfEnums( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['StringEnum']: + return StringEnum + + def __new__( + cls, + arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayOfEnums': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'StringEnum': + return super().__getitem__(i) + +from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index ca9f73cf200..ff0f7224a38 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -57,18 +55,28 @@ class ArrayOfNumberOnly( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + __annotations__ = { + "ArrayNumber": ArrayNumber, + } additional_properties = schemas.AnyTypeSchema ArrayNumber: MetaOapg.properties.ArrayNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ArrayOfNumberOnly': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi new file mode 100644 index 00000000000..ff0f7224a38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayOfNumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class ArrayNumber( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayNumber': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "ArrayNumber": ArrayNumber, + } + additional_properties = schemas.AnyTypeSchema + + ArrayNumber: MetaOapg.properties.ArrayNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ArrayOfNumberOnly': + return super().__new__( + cls, + *args, + ArrayNumber=ArrayNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index 14f7c0cffd2..72a10964b44 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -57,7 +55,7 @@ class ArrayTest( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -88,7 +86,7 @@ class ArrayTest( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) def __new__( @@ -102,7 +100,7 @@ class ArrayTest( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -137,7 +135,7 @@ class ArrayTest( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'ReadOnlyFirst': return super().__getitem__(i) def __new__( @@ -151,22 +149,40 @@ class ArrayTest( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + __annotations__ = { + "array_of_string": array_of_string, + "array_array_of_integer": array_array_of_integer, + "array_array_of_model": array_array_of_model, + } additional_properties = schemas.AnyTypeSchema array_of_string: MetaOapg.properties.array_of_string array_array_of_integer: MetaOapg.properties.array_array_of_integer array_array_of_model: MetaOapg.properties.array_array_of_model + + @typing.overload + def __getitem__(self, name: typing.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], array_of_string: typing.Union[MetaOapg.properties.array_of_string, tuple, schemas.Unset] = schemas.unset, array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, tuple, schemas.Unset] = schemas.unset, array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ArrayTest': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi new file mode 100644 index 00000000000..72a10964b44 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class array_of_string( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'array_of_string': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class array_array_of_integer( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.Int64Schema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, int, ]], typing.List[typing.Union[MetaOapg.items, int, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_array_of_integer': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class array_array_of_model( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['ReadOnlyFirst']: + return ReadOnlyFirst + + def __new__( + cls, + arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'ReadOnlyFirst': + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_array_of_model': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "array_of_string": array_of_string, + "array_array_of_integer": array_array_of_integer, + "array_array_of_model": array_array_of_model, + } + additional_properties = schemas.AnyTypeSchema + + array_of_string: MetaOapg.properties.array_of_string + array_array_of_integer: MetaOapg.properties.array_array_of_integer + array_array_of_model: MetaOapg.properties.array_array_of_model + + @typing.overload + def __getitem__(self, name: typing.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + array_of_string: typing.Union[MetaOapg.properties.array_of_string, tuple, schemas.Unset] = schemas.unset, + array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, tuple, schemas.Unset] = schemas.unset, + array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ArrayTest': + return super().__new__( + cls, + *args, + array_of_string=array_of_string, + array_array_of_integer=array_array_of_integer, + array_array_of_model=array_array_of_model, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py index 43db6f04212..1332edb9dd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -57,5 +55,5 @@ class ArrayWithValidationsInItems( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi new file mode 100644 index 00000000000..c6667fffabc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ArrayWithValidationsInItems( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class items( + schemas.Int64Schema + ): + pass + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, int, ]], typing.List[typing.Union[MetaOapg.items, int, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayWithValidationsInItems': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index cdbb031c9eb..2b234860649 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -40,16 +38,26 @@ class Banana( } class properties: lengthCm = schemas.NumberSchema + __annotations__ = { + "lengthCm": lengthCm, + } additional_properties = schemas.AnyTypeSchema lengthCm: MetaOapg.properties.lengthCm + + @typing.overload + def __getitem__(self, name: typing.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Banana': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi new file mode 100644 index 00000000000..2b234860649 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Banana( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "lengthCm", + } + class properties: + lengthCm = schemas.NumberSchema + __annotations__ = { + "lengthCm": lengthCm, + } + additional_properties = schemas.AnyTypeSchema + + lengthCm: MetaOapg.properties.lengthCm + + @typing.overload + def __getitem__(self, name: typing.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Banana': + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 58f41a1d7a2..809e3392360 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,14 +39,26 @@ class BananaReq( class properties: lengthCm = schemas.NumberSchema sweet = schemas.BoolSchema + __annotations__ = { + "lengthCm": lengthCm, + "sweet": sweet, + } additional_properties = None lengthCm: MetaOapg.properties.lengthCm sweet: MetaOapg.properties.sweet + + @typing.overload + def __getitem__(self, name: typing.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + def __getitem__(self, name: typing.Literal["sweet"]) -> MetaOapg.properties.sweet: + # dict_instance[name] accessor + return super().__getitem__(name) + def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi new file mode 100644 index 00000000000..809e3392360 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BananaReq( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "lengthCm", + } + class properties: + lengthCm = schemas.NumberSchema + sweet = schemas.BoolSchema + __annotations__ = { + "lengthCm": lengthCm, + "sweet": sweet, + } + additional_properties = None + + lengthCm: MetaOapg.properties.lengthCm + sweet: MetaOapg.properties.sweet + + @typing.overload + def __getitem__(self, name: typing.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + def __getitem__(self, name: typing.Literal["sweet"]) -> MetaOapg.properties.sweet: + # dict_instance[name] accessor + return super().__getitem__(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], + sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'BananaReq': + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + sweet=sweet, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py index 30d282c1574..9b110d0b889 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 Bar = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi new file mode 100644 index 00000000000..9b110d0b889 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Bar = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index 23483dd9b74..ebb77174d75 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -54,16 +52,26 @@ class BasquePig( @property def BASQUE_PIG(cls): return cls("BasquePig") + __annotations__ = { + "className": className, + } additional_properties = schemas.AnyTypeSchema className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], className: typing.Union[MetaOapg.properties.className, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'BasquePig': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi new file mode 100644 index 00000000000..ebb77174d75 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BasquePig( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "className", + } + class properties: + + + class className( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "BasquePig": "BASQUE_PIG", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def BASQUE_PIG(cls): + return cls("BasquePig") + __annotations__ = { + "className": className, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'BasquePig': + return super().__new__( + cls, + *args, + className=className, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py index 693551f39fa..670a9a5c47f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 Boolean = schemas.BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi new file mode 100644 index 00000000000..670a9a5c47f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Boolean = schemas.BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py index cc7bb112e78..799387c8390 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi new file mode 100644 index 00000000000..799387c8390 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class BooleanEnum( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + schemas.BoolClass.TRUE: "TRUE", + } + ), + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def TRUE(cls): + return cls(schemas.BoolClass.TRUE) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 7f2747c5eb0..dc41a315878 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -42,6 +40,14 @@ class Capitalization( Capital_Snake = schemas.StrSchema SCA_ETH_Flow_Points = schemas.StrSchema ATT_NAME = schemas.StrSchema + __annotations__ = { + "smallCamel": smallCamel, + "CapitalCamel": CapitalCamel, + "small_Snake": small_Snake, + "Capital_Snake": Capital_Snake, + "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, + "ATT_NAME": ATT_NAME, + } additional_properties = schemas.AnyTypeSchema smallCamel: MetaOapg.properties.smallCamel @@ -50,10 +56,32 @@ class Capitalization( Capital_Snake: MetaOapg.properties.Capital_Snake SCA_ETH_Flow_Points: MetaOapg.properties.SCA_ETH_Flow_Points ATT_NAME: MetaOapg.properties.ATT_NAME + + @typing.overload + def __getitem__(self, name: typing.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, @@ -61,7 +89,7 @@ class Capitalization( SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Capitalization': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi new file mode 100644 index 00000000000..dc41a315878 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Capitalization( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + smallCamel = schemas.StrSchema + CapitalCamel = schemas.StrSchema + small_Snake = schemas.StrSchema + Capital_Snake = schemas.StrSchema + SCA_ETH_Flow_Points = schemas.StrSchema + ATT_NAME = schemas.StrSchema + __annotations__ = { + "smallCamel": smallCamel, + "CapitalCamel": CapitalCamel, + "small_Snake": small_Snake, + "Capital_Snake": Capital_Snake, + "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, + "ATT_NAME": ATT_NAME, + } + additional_properties = schemas.AnyTypeSchema + + smallCamel: MetaOapg.properties.smallCamel + CapitalCamel: MetaOapg.properties.CapitalCamel + small_Snake: MetaOapg.properties.small_Snake + Capital_Snake: MetaOapg.properties.Capital_Snake + SCA_ETH_Flow_Points: MetaOapg.properties.SCA_ETH_Flow_Points + ATT_NAME: MetaOapg.properties.ATT_NAME + + @typing.overload + def __getitem__(self, name: typing.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, + CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, + small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, + Capital_Snake: typing.Union[MetaOapg.properties.Capital_Snake, str, schemas.Unset] = schemas.unset, + SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, + ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Capitalization': + return super().__new__( + cls, + *args, + smallCamel=smallCamel, + CapitalCamel=CapitalCamel, + small_Snake=small_Snake, + Capital_Snake=Capital_Snake, + SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, + ATT_NAME=ATT_NAME, + _configuration=_configuration, + **kwargs, + ) 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 c6770828f05..671a518e549 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -46,16 +44,26 @@ class Cat( class MetaOapg: class properties: declawed = schemas.BoolSchema + __annotations__ = { + "declawed": declawed, + } additional_properties = schemas.AnyTypeSchema declawed: MetaOapg.properties.declawed + + @typing.overload + def __getitem__(self, name: typing.Literal["declawed"]) -> MetaOapg.properties.declawed: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -81,12 +89,16 @@ class Cat( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Cat': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi new file mode 100644 index 00000000000..671a518e549 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Cat( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + declawed = schemas.BoolSchema + __annotations__ = { + "declawed": declawed, + } + additional_properties = schemas.AnyTypeSchema + + declawed: MetaOapg.properties.declawed + + @typing.overload + def __getitem__(self, name: typing.Literal["declawed"]) -> MetaOapg.properties.declawed: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + declawed=declawed, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + Animal, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Cat': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index 95de35ce3f2..c5d7bebc09a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,20 +37,34 @@ class Category( "name", } class properties: - id = schemas.Int64Schema name = schemas.StrSchema + id = schemas.Int64Schema + __annotations__ = { + "name": name, + "id": id, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name id: MetaOapg.properties.id + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], name: typing.Union[MetaOapg.properties.name, str, ], id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Category': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi new file mode 100644 index 00000000000..c5d7bebc09a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Category( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "name", + } + class properties: + name = schemas.StrSchema + id = schemas.Int64Schema + __annotations__ = { + "name": name, + "id": id, + } + additional_properties = schemas.AnyTypeSchema + + name: MetaOapg.properties.name + id: MetaOapg.properties.id + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Category': + return super().__new__( + cls, + *args, + name=name, + id=id, + _configuration=_configuration, + **kwargs, + ) 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 6ed89b25e40..8d4e029e08a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -46,16 +44,26 @@ class ChildCat( class MetaOapg: class properties: name = schemas.StrSchema + __annotations__ = { + "name": name, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -81,12 +89,16 @@ class ChildCat( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ChildCat': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi new file mode 100644 index 00000000000..8d4e029e08a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ChildCat( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + name = schemas.StrSchema + __annotations__ = { + "name": name, + } + additional_properties = schemas.AnyTypeSchema + + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + name=name, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + ParentPet, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ChildCat': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index 17ce3e1f143..53bfdeb1fe9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,17 +37,27 @@ class ClassModel( class MetaOapg: class properties: _class = schemas.StrSchema + __annotations__ = { + "_class": _class, + } additional_properties = schemas.AnyTypeSchema _class: MetaOapg.properties._class + + @typing.overload + def __getitem__(self, name: typing.Literal["_class"]) -> MetaOapg.properties._class: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ClassModel': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi new file mode 100644 index 00000000000..53bfdeb1fe9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ClassModel( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing model with "_class" property + """ + + + class MetaOapg: + class properties: + _class = schemas.StrSchema + __annotations__ = { + "_class": _class, + } + additional_properties = schemas.AnyTypeSchema + + + _class: MetaOapg.properties._class + + @typing.overload + def __getitem__(self, name: typing.Literal["_class"]) -> MetaOapg.properties._class: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ClassModel': + return super().__new__( + cls, + *args, + _class=_class, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index ab253b8746c..38e5db28e9c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,16 +35,26 @@ class Client( class MetaOapg: class properties: client = schemas.StrSchema + __annotations__ = { + "client": client, + } additional_properties = schemas.AnyTypeSchema client: MetaOapg.properties.client + + @typing.overload + def __getitem__(self, name: typing.Literal["client"]) -> MetaOapg.properties.client: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Client': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi new file mode 100644 index 00000000000..38e5db28e9c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Client( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + client = schemas.StrSchema + __annotations__ = { + "client": client, + } + additional_properties = schemas.AnyTypeSchema + + client: MetaOapg.properties.client + + @typing.overload + def __getitem__(self, name: typing.Literal["client"]) -> MetaOapg.properties.client: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Client': + return super().__new__( + cls, + *args, + client=client, + _configuration=_configuration, + **kwargs, + ) 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 96d4104c381..3c26147727d 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,16 +58,26 @@ class ComplexQuadrilateral( @property def COMPLEX_QUADRILATERAL(cls): return cls("ComplexQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } additional_properties = schemas.AnyTypeSchema quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -95,12 +103,16 @@ class ComplexQuadrilateral( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ComplexQuadrilateral': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi new file mode 100644 index 00000000000..3c26147727d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComplexQuadrilateral( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + + + class quadrilateralType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "ComplexQuadrilateral": "COMPLEX_QUADRILATERAL", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def COMPLEX_QUADRILATERAL(cls): + return cls("ComplexQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } + additional_properties = schemas.AnyTypeSchema + + quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + QuadrilateralInterface, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ComplexQuadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface 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 3b9a6338bef..fb7d1e5ae02 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -57,7 +55,7 @@ class ComposedAnyOfDifferentTypesNoValidations( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'any_of_9': return super().__new__( @@ -66,7 +64,7 @@ class ComposedAnyOfDifferentTypesNoValidations( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) any_of_10 = schemas.NumberSchema any_of_11 = schemas.Float32Schema @@ -105,12 +103,16 @@ class ComposedAnyOfDifferentTypesNoValidations( cls.any_of_15, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ComposedAnyOfDifferentTypesNoValidations': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi new file mode 100644 index 00000000000..fb7d1e5ae02 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedAnyOfDifferentTypesNoValidations( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + any_of_0 = schemas.DictSchema + any_of_1 = schemas.DateSchema + any_of_2 = schemas.DateTimeSchema + any_of_3 = schemas.BinarySchema + any_of_4 = schemas.StrSchema + any_of_5 = schemas.StrSchema + any_of_6 = schemas.DictSchema + any_of_7 = schemas.BoolSchema + any_of_8 = schemas.NoneSchema + + + class any_of_9( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.AnyTypeSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'any_of_9': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + any_of_10 = schemas.NumberSchema + any_of_11 = schemas.Float32Schema + any_of_12 = schemas.Float64Schema + any_of_13 = schemas.IntSchema + any_of_14 = schemas.Int32Schema + any_of_15 = schemas.Int64Schema + + @classmethod + @property + @functools.cache + def any_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.any_of_0, + cls.any_of_1, + cls.any_of_2, + cls.any_of_3, + cls.any_of_4, + cls.any_of_5, + cls.any_of_6, + cls.any_of_7, + cls.any_of_8, + cls.any_of_9, + cls.any_of_10, + cls.any_of_11, + cls.any_of_12, + cls.any_of_13, + cls.any_of_14, + cls.any_of_15, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ComposedAnyOfDifferentTypesNoValidations': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py index 5be20b3ffb4..8d8c0c8407a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,7 +37,7 @@ class ComposedArray( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'ComposedArray': return super().__new__( @@ -48,5 +46,5 @@ class ComposedArray( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi new file mode 100644 index 00000000000..8d8c0c8407a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedArray( + schemas.ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + items = schemas.AnyTypeSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ComposedArray': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) 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 6f51a056acd..a52f5bc512f 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi new file mode 100644 index 00000000000..a52f5bc512f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedBool( + schemas.ComposedBase, + schemas.BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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[bool, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ComposedBool': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) 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 2b0c6c8b866..330b88a6cff 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi new file mode 100644 index 00000000000..330b88a6cff --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedNone( + schemas.ComposedBase, + schemas.NoneSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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[None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ComposedNone': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) 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 6a2b76f9923..85488eb2b82 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi new file mode 100644 index 00000000000..85488eb2b82 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedNumber( + schemas.ComposedBase, + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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[decimal.Decimal, int, float, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ComposedNumber': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) 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 593cd6bff51..c5c3dc6eb73 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -54,12 +52,16 @@ class ComposedObject( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ComposedObject': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi new file mode 100644 index 00000000000..c5c3dc6eb73 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedObject( + schemas.ComposedBase, + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ComposedObject': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 84355df077b..9aed9e0f413 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -51,12 +49,16 @@ class ComposedOneOfDifferentTypes( additional_properties = schemas.AnyTypeSchema max_properties = 4 min_properties = 4 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'one_of_4': return super().__new__( cls, @@ -78,7 +80,7 @@ class ComposedOneOfDifferentTypes( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'one_of_5': return super().__new__( @@ -87,7 +89,7 @@ class ComposedOneOfDifferentTypes( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -122,12 +124,16 @@ class ComposedOneOfDifferentTypes( cls.one_of_6, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ComposedOneOfDifferentTypes': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi new file mode 100644 index 00000000000..e2f0656306a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedOneOfDifferentTypes( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + this is a model that allows payloads of type object or number + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_2 = schemas.NoneSchema + one_of_3 = schemas.DateSchema + + + class one_of_4( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'one_of_4': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class one_of_5( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.AnyTypeSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'one_of_5': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class one_of_6( + schemas.DateTimeSchema + ): + pass + + @classmethod + @property + @functools.cache + def one_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 [ + NumberWithValidations, + Animal, + cls.one_of_2, + cls.one_of_3, + cls.one_of_4, + cls.one_of_5, + cls.one_of_6, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ComposedOneOfDifferentTypes': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal +from petstore_api.model.number_with_validations import NumberWithValidations 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 03cbbf8a41b..1634087321c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi new file mode 100644 index 00000000000..1634087321c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ComposedString( + schemas.ComposedBase, + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + all_of_0 = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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[str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ComposedString': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py index 7b0871da6e7..e6751f0323b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi new file mode 100644 index 00000000000..e6751f0323b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Currency( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "eur": "EUR", + "usd": "USD", + } + ), + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def EUR(cls): + return cls("eur") + + @classmethod + @property + def USD(cls): + return cls("usd") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 0ffec563ad1..d638204f973 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -54,16 +52,26 @@ class DanishPig( @property def DANISH_PIG(cls): return cls("DanishPig") + __annotations__ = { + "className": className, + } additional_properties = schemas.AnyTypeSchema className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], className: typing.Union[MetaOapg.properties.className, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'DanishPig': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi new file mode 100644 index 00000000000..d638204f973 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DanishPig( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "className", + } + class properties: + + + class className( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "DanishPig": "DANISH_PIG", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def DANISH_PIG(cls): + return cls("DanishPig") + __annotations__ = { + "className": className, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'DanishPig': + return super().__new__( + cls, + *args, + className=className, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py index 1d5987bb260..9a3a7f0b7fe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 DateTimeTest = schemas.DateTimeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi new file mode 100644 index 00000000000..9a3a7f0b7fe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +DateTimeTest = schemas.DateTimeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py index fab3700ebfd..b27af8ab547 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi new file mode 100644 index 00000000000..1e4cb825143 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DateTimeWithValidations( + schemas.DateTimeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py index bed4cd2cacb..ee1423ed955 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi new file mode 100644 index 00000000000..08b4ec2a206 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class DateWithValidations( + schemas.DateSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py index 5f3543fb384..3063189bbba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 DecimalPayload = schemas.DecimalSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi new file mode 100644 index 00000000000..3063189bbba --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +DecimalPayload = schemas.DecimalSchema 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 4b38cc9eb9b..feb74f9e8ab 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -46,16 +44,26 @@ class Dog( class MetaOapg: class properties: breed = schemas.StrSchema + __annotations__ = { + "breed": breed, + } additional_properties = schemas.AnyTypeSchema breed: MetaOapg.properties.breed + + @typing.overload + def __getitem__(self, name: typing.Literal["breed"]) -> MetaOapg.properties.breed: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -81,12 +89,16 @@ class Dog( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Dog': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi new file mode 100644 index 00000000000..feb74f9e8ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Dog( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + breed = schemas.StrSchema + __annotations__ = { + "breed": breed, + } + additional_properties = schemas.AnyTypeSchema + + breed: MetaOapg.properties.breed + + @typing.overload + def __getitem__(self, name: typing.Literal["breed"]) -> MetaOapg.properties.breed: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + breed=breed, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + Animal, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Dog': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index 21318833e9e..ce35e7e6d25 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -76,8 +74,14 @@ class Drawing( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Shape': return super().__getitem__(i) + __annotations__ = { + "mainShape": mainShape, + "shapeOrNull": shapeOrNull, + "nullableShape": nullableShape, + "shapes": shapes, + } @classmethod @property @@ -88,10 +92,26 @@ class Drawing( shapeOrNull: 'ShapeOrNull' nullableShape: 'NullableShape' shapes: MetaOapg.properties.shapes + + @typing.overload + def __getitem__(self, name: typing.Literal["mainShape"]) -> 'Shape': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["nullableShape"]) -> 'NullableShape': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shapes"]) -> MetaOapg.properties.shapes: ... + + def __getitem__(self, name: str) -> 'Fruit': + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi new file mode 100644 index 00000000000..ce35e7e6d25 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Drawing( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + @classmethod + @property + def mainShape(cls) -> typing.Type['Shape']: + return Shape + + @classmethod + @property + def shapeOrNull(cls) -> typing.Type['ShapeOrNull']: + return ShapeOrNull + + @classmethod + @property + def nullableShape(cls) -> typing.Type['NullableShape']: + return NullableShape + + + class shapes( + schemas.ListSchema + ): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Shape']: + return Shape + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Shape'], typing.List['Shape']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'shapes': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Shape': + return super().__getitem__(i) + __annotations__ = { + "mainShape": mainShape, + "shapeOrNull": shapeOrNull, + "nullableShape": nullableShape, + "shapes": shapes, + } + + @classmethod + @property + def additional_properties(cls) -> typing.Type['Fruit']: + return Fruit + + mainShape: 'Shape' + shapeOrNull: 'ShapeOrNull' + nullableShape: 'NullableShape' + shapes: MetaOapg.properties.shapes + + @typing.overload + def __getitem__(self, name: typing.Literal["mainShape"]) -> 'Shape': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["nullableShape"]) -> 'NullableShape': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shapes"]) -> MetaOapg.properties.shapes: ... + + def __getitem__(self, name: str) -> 'Fruit': + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, + shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, + nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, + shapes: typing.Union[MetaOapg.properties.shapes, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: 'Fruit', + ) -> 'Drawing': + return super().__new__( + cls, + *args, + mainShape=mainShape, + shapeOrNull=shapeOrNull, + nullableShape=nullableShape, + shapes=shapes, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.fruit import Fruit +from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.shape import Shape +from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 3ec3bace81b..c55554a4dc0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -98,20 +96,34 @@ class EnumArrays( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + __annotations__ = { + "just_symbol": just_symbol, + "array_enum": array_enum, + } additional_properties = schemas.AnyTypeSchema just_symbol: MetaOapg.properties.just_symbol array_enum: MetaOapg.properties.array_enum + + @typing.overload + def __getitem__(self, name: typing.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, array_enum: typing.Union[MetaOapg.properties.array_enum, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'EnumArrays': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi new file mode 100644 index 00000000000..c55554a4dc0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumArrays( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class just_symbol( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + ">=": "GREATER_THAN_EQUALS", + "$": "DOLLAR", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def GREATER_THAN_EQUALS(cls): + return cls(">=") + + @classmethod + @property + def DOLLAR(cls): + return cls("$") + + + class array_enum( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "fish": "FISH", + "crab": "CRAB", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def FISH(cls): + return cls("fish") + + @classmethod + @property + def CRAB(cls): + return cls("crab") + + 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, + ) -> 'array_enum': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "just_symbol": just_symbol, + "array_enum": array_enum, + } + additional_properties = schemas.AnyTypeSchema + + just_symbol: MetaOapg.properties.just_symbol + array_enum: MetaOapg.properties.array_enum + + @typing.overload + def __getitem__(self, name: typing.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, + array_enum: typing.Union[MetaOapg.properties.array_enum, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'EnumArrays': + return super().__new__( + cls, + *args, + just_symbol=just_symbol, + array_enum=array_enum, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index dceedc21dff..788d9346844 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi new file mode 100644 index 00000000000..788d9346844 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumClass( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + "COUNT_1M": "COUNT_1M", + "COUNT_50M": "COUNT_50M", + } + ), + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def _ABC(cls): + return cls("_abc") + + @classmethod + @property + def EFG(cls): + return cls("-efg") + + @classmethod + @property + def XYZ(cls): + return cls("(xyz)") + + @classmethod + @property + def COUNT_1M(cls): + return cls("COUNT_1M") + + @classmethod + @property + def COUNT_50M(cls): + return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index fbf136e3edf..23a5b6c4596 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,7 +39,7 @@ class EnumTest( class properties: - class enum_string( + class enum_string_required( schemas.SchemaEnumMakerClsFactory( enum_value_to_name={ "UPPER": "UPPER", @@ -68,7 +66,7 @@ class EnumTest( return cls("") - class enum_string_required( + class enum_string( schemas.SchemaEnumMakerClsFactory( enum_value_to_name={ "UPPER": "UPPER", @@ -160,6 +158,17 @@ class EnumTest( @property def IntegerEnumOneValue(cls) -> typing.Type['IntegerEnumOneValue']: return IntegerEnumOneValue + __annotations__ = { + "enum_string_required": enum_string_required, + "enum_string": enum_string, + "enum_integer": enum_integer, + "enum_number": enum_number, + "stringEnum": stringEnum, + "IntegerEnum": IntegerEnum, + "StringEnumWithDefaultValue": StringEnumWithDefaultValue, + "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, + "IntegerEnumOneValue": IntegerEnumOneValue, + } additional_properties = schemas.AnyTypeSchema enum_string_required: MetaOapg.properties.enum_string_required @@ -171,10 +180,41 @@ class EnumTest( StringEnumWithDefaultValue: 'StringEnumWithDefaultValue' IntegerEnumWithDefaultValue: 'IntegerEnumWithDefaultValue' IntegerEnumOneValue: 'IntegerEnumOneValue' + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["stringEnum"]) -> 'StringEnum': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnum"]) -> 'IntegerEnum': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, enum_integer: typing.Union[MetaOapg.properties.enum_integer, int, schemas.Unset] = schemas.unset, @@ -185,7 +225,7 @@ class EnumTest( IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'EnumTest': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi new file mode 100644 index 00000000000..23a5b6c4596 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EnumTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "enum_string_required", + } + class properties: + + + class enum_string_required( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls("lower") + + @classmethod + @property + def EMPTY(cls): + return cls("") + + + class enum_string( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls("lower") + + @classmethod + @property + def EMPTY(cls): + return cls("") + + + class enum_integer( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1: "POSITIVE_1", + -1: "NEGATIVE_1", + } + ), + schemas.Int32Schema + ): + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) + + @classmethod + @property + def NEGATIVE_1(cls): + return cls(-1) + + + class enum_number( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + ), + schemas.Float64Schema + ): + + @classmethod + @property + def POSITIVE_1_PT_1(cls): + return cls(1.1) + + @classmethod + @property + def NEGATIVE_1_PT_2(cls): + return cls(-1.2) + + @classmethod + @property + def stringEnum(cls) -> typing.Type['StringEnum']: + return StringEnum + + @classmethod + @property + def IntegerEnum(cls) -> typing.Type['IntegerEnum']: + return IntegerEnum + + @classmethod + @property + def StringEnumWithDefaultValue(cls) -> typing.Type['StringEnumWithDefaultValue']: + return StringEnumWithDefaultValue + + @classmethod + @property + def IntegerEnumWithDefaultValue(cls) -> typing.Type['IntegerEnumWithDefaultValue']: + return IntegerEnumWithDefaultValue + + @classmethod + @property + def IntegerEnumOneValue(cls) -> typing.Type['IntegerEnumOneValue']: + return IntegerEnumOneValue + __annotations__ = { + "enum_string_required": enum_string_required, + "enum_string": enum_string, + "enum_integer": enum_integer, + "enum_number": enum_number, + "stringEnum": stringEnum, + "IntegerEnum": IntegerEnum, + "StringEnumWithDefaultValue": StringEnumWithDefaultValue, + "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, + "IntegerEnumOneValue": IntegerEnumOneValue, + } + additional_properties = schemas.AnyTypeSchema + + enum_string_required: MetaOapg.properties.enum_string_required + enum_string: MetaOapg.properties.enum_string + enum_integer: MetaOapg.properties.enum_integer + enum_number: MetaOapg.properties.enum_number + stringEnum: 'StringEnum' + IntegerEnum: 'IntegerEnum' + StringEnumWithDefaultValue: 'StringEnumWithDefaultValue' + IntegerEnumWithDefaultValue: 'IntegerEnumWithDefaultValue' + IntegerEnumOneValue: 'IntegerEnumOneValue' + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["stringEnum"]) -> 'StringEnum': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnum"]) -> 'IntegerEnum': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], + enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, + enum_integer: typing.Union[MetaOapg.properties.enum_integer, int, schemas.Unset] = schemas.unset, + enum_number: typing.Union[MetaOapg.properties.enum_number, float, schemas.Unset] = schemas.unset, + stringEnum: typing.Union['StringEnum', schemas.Unset] = schemas.unset, + IntegerEnum: typing.Union['IntegerEnum', schemas.Unset] = schemas.unset, + StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', schemas.Unset] = schemas.unset, + IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, + IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'EnumTest': + return super().__new__( + cls, + *args, + enum_string_required=enum_string_required, + enum_string=enum_string, + enum_integer=enum_integer, + enum_number=enum_number, + stringEnum=stringEnum, + IntegerEnum=IntegerEnum, + StringEnumWithDefaultValue=StringEnumWithDefaultValue, + IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, + IntegerEnumOneValue=IntegerEnumOneValue, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue 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 d4a85e194b6..c5d59066a9a 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,16 +58,26 @@ class EquilateralTriangle( @property def EQUILATERAL_TRIANGLE(cls): return cls("EquilateralTriangle") + __annotations__ = { + "triangleType": triangleType, + } additional_properties = schemas.AnyTypeSchema triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -95,12 +103,16 @@ class EquilateralTriangle( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'EquilateralTriangle': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi new file mode 100644 index 00000000000..c5d59066a9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class EquilateralTriangle( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + + + class triangleType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "EquilateralTriangle": "EQUILATERAL_TRIANGLE", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def EQUILATERAL_TRIANGLE(cls): + return cls("EquilateralTriangle") + __annotations__ = { + "triangleType": triangleType, + } + additional_properties = schemas.AnyTypeSchema + + triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + TriangleInterface, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'EquilateralTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index 29f65a7386d..d9963887e13 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,16 +37,26 @@ class File( class MetaOapg: class properties: sourceURI = schemas.StrSchema + __annotations__ = { + "sourceURI": sourceURI, + } additional_properties = schemas.AnyTypeSchema sourceURI: MetaOapg.properties.sourceURI + + @typing.overload + def __getitem__(self, name: typing.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'File': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi new file mode 100644 index 00000000000..d9963887e13 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class File( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Must be named `File` for test. + """ + + + class MetaOapg: + class properties: + sourceURI = schemas.StrSchema + __annotations__ = { + "sourceURI": sourceURI, + } + additional_properties = schemas.AnyTypeSchema + + sourceURI: MetaOapg.properties.sourceURI + + @typing.overload + def __getitem__(self, name: typing.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'File': + return super().__new__( + cls, + *args, + sourceURI=sourceURI, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 2c00ea3fac3..87220b13bd6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -66,20 +64,34 @@ class FileSchemaTestClass( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'File': return super().__getitem__(i) + __annotations__ = { + "file": file, + "files": files, + } additional_properties = schemas.AnyTypeSchema file: 'File' files: MetaOapg.properties.files + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> 'File': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["files"]) -> MetaOapg.properties.files: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], file: typing.Union['File', schemas.Unset] = schemas.unset, files: typing.Union[MetaOapg.properties.files, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'FileSchemaTestClass': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi new file mode 100644 index 00000000000..87220b13bd6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FileSchemaTestClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + @classmethod + @property + def file(cls) -> typing.Type['File']: + return File + + + class files( + schemas.ListSchema + ): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['File']: + return File + + def __new__( + cls, + arg: typing.Union[typing.Tuple['File'], typing.List['File']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'files': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'File': + return super().__getitem__(i) + __annotations__ = { + "file": file, + "files": files, + } + additional_properties = schemas.AnyTypeSchema + + file: 'File' + files: MetaOapg.properties.files + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> 'File': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["files"]) -> MetaOapg.properties.files: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + file: typing.Union['File', schemas.Unset] = schemas.unset, + files: typing.Union[MetaOapg.properties.files, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'FileSchemaTestClass': + return super().__new__( + cls, + *args, + file=file, + files=files, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 6966b00f7f7..094265067b1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,16 +35,26 @@ class Foo( class MetaOapg: class properties: bar = schemas.StrSchema + __annotations__ = { + "bar": bar, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Foo': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi new file mode 100644 index 00000000000..094265067b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Foo( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + bar = schemas.StrSchema + __annotations__ = { + "bar": bar, + } + additional_properties = schemas.AnyTypeSchema + + bar: MetaOapg.properties.bar + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Foo': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 7919c23c205..a79bc8711d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -44,6 +42,29 @@ class FormatTest( class properties: + class number( + schemas.NumberSchema + ): + + + class MetaOapg: + inclusive_maximum = 543.2 + inclusive_minimum = 32.1 + multiple_of = 32.5 + byte = schemas.StrSchema + date = schemas.DateSchema + + + class password( + schemas.StrSchema + ): + + + class MetaOapg: + max_length = 64 + min_length = 10 + + class integer( schemas.IntSchema ): @@ -67,17 +88,6 @@ class FormatTest( int64 = schemas.Int64Schema - class number( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 543.2 - inclusive_minimum = 32.1 - multiple_of = 32.5 - - class _float( schemas.Float32Schema ): @@ -86,18 +96,6 @@ class FormatTest( class MetaOapg: inclusive_maximum = 987.6 inclusive_minimum = 54.3 - locals()["float"] = _float - del locals()['_float'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ float32 = schemas.Float32Schema @@ -132,7 +130,7 @@ class FormatTest( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -148,24 +146,12 @@ class FormatTest( re.IGNORECASE ) }] - byte = schemas.StrSchema binary = schemas.BinarySchema - date = schemas.DateSchema dateTime = schemas.DateTimeSchema uuid = schemas.UUIDSchema uuidNoExample = schemas.UUIDSchema - class password( - schemas.StrSchema - ): - - - class MetaOapg: - max_length = 64 - min_length = 10 - - class pattern_with_digits( schemas.StrSchema ): @@ -190,6 +176,29 @@ class FormatTest( ) }] noneProp = schemas.NoneSchema + __annotations__ = { + "number": number, + "byte": byte, + "date": date, + "password": password, + "integer": integer, + "int32": int32, + "int32withValidations": int32withValidations, + "int64": int64, + "float": _float, + "float32": float32, + "double": double, + "float64": float64, + "arrayWithUniqueItems": arrayWithUniqueItems, + "string": string, + "binary": binary, + "dateTime": dateTime, + "uuid": uuid, + "uuidNoExample": uuidNoExample, + "pattern_with_digits": pattern_with_digits, + "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, + "noneProp": noneProp, + } additional_properties = schemas.AnyTypeSchema date: MetaOapg.properties.date @@ -212,10 +221,77 @@ class FormatTest( pattern_with_digits: MetaOapg.properties.pattern_with_digits pattern_with_digits_and_delimiter: MetaOapg.properties.pattern_with_digits_and_delimiter noneProp: MetaOapg.properties.noneProp + + @typing.overload + def __getitem__(self, name: typing.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float32"]) -> MetaOapg.properties.float32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float64"]) -> MetaOapg.properties.float64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], date: typing.Union[MetaOapg.properties.date, date, str, ], number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], password: typing.Union[MetaOapg.properties.password, str, ], @@ -237,7 +313,7 @@ class FormatTest( pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'FormatTest': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi new file mode 100644 index 00000000000..197a3be9c47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi @@ -0,0 +1,295 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FormatTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "date", + "number", + "password", + "byte", + } + class properties: + + + class number( + schemas.NumberSchema + ): + pass + byte = schemas.StrSchema + date = schemas.DateSchema + + + class password( + schemas.StrSchema + ): + pass + + + class integer( + schemas.IntSchema + ): + pass + int32 = schemas.Int32Schema + + + class int32withValidations( + schemas.Int32Schema + ): + pass + int64 = schemas.Int64Schema + + + class _float( + schemas.Float32Schema + ): + pass + float32 = schemas.Float32Schema + + + class double( + schemas.Float64Schema + ): + pass + float64 = schemas.Float64Schema + + + class arrayWithUniqueItems( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'arrayWithUniqueItems': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class string( + schemas.StrSchema + ): + pass + binary = schemas.BinarySchema + dateTime = schemas.DateTimeSchema + uuid = schemas.UUIDSchema + uuidNoExample = schemas.UUIDSchema + + + class pattern_with_digits( + schemas.StrSchema + ): + pass + + + class pattern_with_digits_and_delimiter( + schemas.StrSchema + ): + pass + noneProp = schemas.NoneSchema + __annotations__ = { + "number": number, + "byte": byte, + "date": date, + "password": password, + "integer": integer, + "int32": int32, + "int32withValidations": int32withValidations, + "int64": int64, + "float": _float, + "float32": float32, + "double": double, + "float64": float64, + "arrayWithUniqueItems": arrayWithUniqueItems, + "string": string, + "binary": binary, + "dateTime": dateTime, + "uuid": uuid, + "uuidNoExample": uuidNoExample, + "pattern_with_digits": pattern_with_digits, + "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, + "noneProp": noneProp, + } + additional_properties = schemas.AnyTypeSchema + + date: MetaOapg.properties.date + number: MetaOapg.properties.number + password: MetaOapg.properties.password + byte: MetaOapg.properties.byte + integer: MetaOapg.properties.integer + int32: MetaOapg.properties.int32 + int32withValidations: MetaOapg.properties.int32withValidations + int64: MetaOapg.properties.int64 + float32: MetaOapg.properties.float32 + double: MetaOapg.properties.double + float64: MetaOapg.properties.float64 + arrayWithUniqueItems: MetaOapg.properties.arrayWithUniqueItems + string: MetaOapg.properties.string + binary: MetaOapg.properties.binary + dateTime: MetaOapg.properties.dateTime + uuid: MetaOapg.properties.uuid + uuidNoExample: MetaOapg.properties.uuidNoExample + pattern_with_digits: MetaOapg.properties.pattern_with_digits + pattern_with_digits_and_delimiter: MetaOapg.properties.pattern_with_digits_and_delimiter + noneProp: MetaOapg.properties.noneProp + + @typing.overload + def __getitem__(self, name: typing.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float32"]) -> MetaOapg.properties.float32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float64"]) -> MetaOapg.properties.float64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + date: typing.Union[MetaOapg.properties.date, date, str, ], + number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], + password: typing.Union[MetaOapg.properties.password, str, ], + byte: typing.Union[MetaOapg.properties.byte, str, ], + integer: typing.Union[MetaOapg.properties.integer, int, schemas.Unset] = schemas.unset, + int32: typing.Union[MetaOapg.properties.int32, int, schemas.Unset] = schemas.unset, + int32withValidations: typing.Union[MetaOapg.properties.int32withValidations, int, schemas.Unset] = schemas.unset, + int64: typing.Union[MetaOapg.properties.int64, int, schemas.Unset] = schemas.unset, + float32: typing.Union[MetaOapg.properties.float32, float, schemas.Unset] = schemas.unset, + double: typing.Union[MetaOapg.properties.double, float, schemas.Unset] = schemas.unset, + float64: typing.Union[MetaOapg.properties.float64, float, schemas.Unset] = schemas.unset, + arrayWithUniqueItems: typing.Union[MetaOapg.properties.arrayWithUniqueItems, tuple, schemas.Unset] = schemas.unset, + string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, + binary: typing.Union[MetaOapg.properties.binary, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, datetime, str, schemas.Unset] = schemas.unset, + uuid: typing.Union[MetaOapg.properties.uuid, uuid.UUID, str, schemas.Unset] = schemas.unset, + uuidNoExample: typing.Union[MetaOapg.properties.uuidNoExample, uuid.UUID, str, schemas.Unset] = schemas.unset, + pattern_with_digits: typing.Union[MetaOapg.properties.pattern_with_digits, str, schemas.Unset] = schemas.unset, + pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, + noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'FormatTest': + return super().__new__( + cls, + *args, + date=date, + number=number, + password=password, + byte=byte, + integer=integer, + int32=int32, + int32withValidations=int32withValidations, + int64=int64, + float32=float32, + double=double, + float64=float64, + arrayWithUniqueItems=arrayWithUniqueItems, + string=string, + binary=binary, + dateTime=dateTime, + uuid=uuid, + uuidNoExample=uuidNoExample, + pattern_with_digits=pattern_with_digits, + pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, + noneProp=noneProp, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index b7cc5e24a9d..6c320e9ed79 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,6 +35,9 @@ class Fruit( class MetaOapg: class properties: color = schemas.StrSchema + __annotations__ = { + "color": color, + } additional_properties = schemas.AnyTypeSchema @classmethod @@ -57,13 +58,20 @@ class Fruit( color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Fruit': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi new file mode 100644 index 00000000000..6c320e9ed79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Fruit( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + color = schemas.StrSchema + __annotations__ = { + "color": color, + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + Apple, + Banana, + ] + + + color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Fruit': + return super().__new__( + cls, + *args, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana 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 4a90c88f107..6688933656c 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -55,12 +53,16 @@ class FruitReq( BananaReq, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'FruitReq': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi new file mode 100644 index 00000000000..6688933656c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class FruitReq( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_0 = schemas.NoneSchema + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + AppleReq, + BananaReq, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'FruitReq': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple_req import AppleReq +from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index a39844a04e1..d945d2b5530 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,6 +35,9 @@ class GmFruit( class MetaOapg: class properties: color = schemas.StrSchema + __annotations__ = { + "color": color, + } additional_properties = schemas.AnyTypeSchema @classmethod @@ -57,13 +58,20 @@ class GmFruit( color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'GmFruit': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi new file mode 100644 index 00000000000..d945d2b5530 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class GmFruit( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + color = schemas.StrSchema + __annotations__ = { + "color": color, + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def any_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 [ + Apple, + Banana, + ] + + + color: MetaOapg.properties.color + + @typing.overload + def __getitem__(self, name: typing.Literal["color"]) -> MetaOapg.properties.color: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'GmFruit': + return super().__new__( + cls, + *args, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index b04f75b9a29..793bcc537d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -50,16 +48,26 @@ class GrandparentAnimal( } class properties: pet_type = schemas.StrSchema + __annotations__ = { + "pet_type": pet_type, + } additional_properties = schemas.AnyTypeSchema pet_type: MetaOapg.properties.pet_type + + @typing.overload + def __getitem__(self, name: typing.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'GrandparentAnimal': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi new file mode 100644 index 00000000000..793bcc537d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class GrandparentAnimal( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "pet_type", + } + + @classmethod + @property + def discriminator(cls): + return { + 'pet_type': { + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, + } + } + class properties: + pet_type = schemas.StrSchema + __annotations__ = { + "pet_type": pet_type, + } + additional_properties = schemas.AnyTypeSchema + + pet_type: MetaOapg.properties.pet_type + + @typing.overload + def __getitem__(self, name: typing.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'GrandparentAnimal': + return super().__new__( + cls, + *args, + pet_type=pet_type, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index c41fe4e14f9..ddc6ac0e270 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -38,18 +36,32 @@ class HasOnlyReadOnly( class properties: bar = schemas.StrSchema foo = schemas.StrSchema + __annotations__ = { + "bar": bar, + "foo": foo, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'HasOnlyReadOnly': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi new file mode 100644 index 00000000000..ddc6ac0e270 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class HasOnlyReadOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + bar = schemas.StrSchema + foo = schemas.StrSchema + __annotations__ = { + "bar": bar, + "foo": foo, + } + additional_properties = schemas.AnyTypeSchema + + bar: MetaOapg.properties.bar + foo: MetaOapg.properties.foo + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'HasOnlyReadOnly': + return super().__new__( + cls, + *args, + bar=bar, + foo=foo, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 62bce0a14b3..a642f08fee1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -58,16 +56,26 @@ class HealthCheckResult( *args, _configuration=_configuration, ) + __annotations__ = { + "NullableMessage": NullableMessage, + } additional_properties = schemas.AnyTypeSchema NullableMessage: MetaOapg.properties.NullableMessage + + @typing.overload + def __getitem__(self, name: typing.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'HealthCheckResult': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi new file mode 100644 index 00000000000..a642f08fee1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class HealthCheckResult( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + """ + + + class MetaOapg: + class properties: + + + class NullableMessage( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.StrBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'NullableMessage': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + __annotations__ = { + "NullableMessage": NullableMessage, + } + additional_properties = schemas.AnyTypeSchema + + NullableMessage: MetaOapg.properties.NullableMessage + + @typing.overload + def __getitem__(self, name: typing.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'HealthCheckResult': + return super().__new__( + cls, + *args, + NullableMessage=NullableMessage, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 02b04c2b94e..d2b947845e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi new file mode 100644 index 00000000000..d2b947845e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnum( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + ), + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls(0) + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) + + @classmethod + @property + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py index 408f4029751..d5bcae9ad4e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi new file mode 100644 index 00000000000..d5bcae9ad4e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumBig( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 10: "POSITIVE_10", + 11: "POSITIVE_11", + 12: "POSITIVE_12", + } + ), + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_10(cls): + return cls(10) + + @classmethod + @property + def POSITIVE_11(cls): + return cls(11) + + @classmethod + @property + def POSITIVE_12(cls): + return cls(12) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index 40053bbcd30..f7b65751922 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi new file mode 100644 index 00000000000..f7b65751922 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumOneValue( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 0: "POSITIVE_0", + } + ), + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls(0) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index fd4a1aa25f1..22f571cda60 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi new file mode 100644 index 00000000000..22f571cda60 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerEnumWithDefaultValue( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + ), + schemas.IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls(0) + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) + + @classmethod + @property + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py index 2eb8cde829e..fd539fe8b64 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi new file mode 100644 index 00000000000..496a49f772d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerMax10( + schemas.Int64Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py index 51d02a8dc2b..0494bb36a58 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi new file mode 100644 index 00000000000..0f8469b2709 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IntegerMin15( + schemas.Int64Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass 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 9f20e656aa9..7539343a3b2 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,16 +58,26 @@ class IsoscelesTriangle( @property def ISOSCELES_TRIANGLE(cls): return cls("IsoscelesTriangle") + __annotations__ = { + "triangleType": triangleType, + } additional_properties = schemas.AnyTypeSchema triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -95,12 +103,16 @@ class IsoscelesTriangle( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'IsoscelesTriangle': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi new file mode 100644 index 00000000000..7539343a3b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class IsoscelesTriangle( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + + + class triangleType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "IsoscelesTriangle": "ISOSCELES_TRIANGLE", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def ISOSCELES_TRIANGLE(cls): + return cls("IsoscelesTriangle") + __annotations__ = { + "triangleType": triangleType, + } + additional_properties = schemas.AnyTypeSchema + + triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + TriangleInterface, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'IsoscelesTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index 1c09c748c9e..d82ed0f336a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -65,12 +63,16 @@ class Mammal( Pig, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Mammal': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi new file mode 100644 index 00000000000..d82ed0f336a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Mammal( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'className': { + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + Whale, + Zebra, + Pig, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Mammal': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.pig import Pig +from petstore_api.model.whale import Whale +from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 8e24a89ed24..c15274fe1a7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -53,10 +51,14 @@ class MapTest( class MetaOapg: additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'additional_properties': @@ -66,12 +68,16 @@ class MapTest( _configuration=_configuration, **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], ) -> 'map_map_of_string': return super().__new__( cls, @@ -108,10 +114,14 @@ class MapTest( @property def LOWER(cls): return cls("lower") + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'map_of_enum_string': @@ -130,10 +140,14 @@ class MapTest( class MetaOapg: additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], ) -> 'direct_map': @@ -148,22 +162,44 @@ class MapTest( @property def indirect_map(cls) -> typing.Type['StringBooleanMap']: return StringBooleanMap + __annotations__ = { + "map_map_of_string": map_map_of_string, + "map_of_enum_string": map_of_enum_string, + "direct_map": direct_map, + "indirect_map": indirect_map, + } additional_properties = schemas.AnyTypeSchema map_map_of_string: MetaOapg.properties.map_map_of_string map_of_enum_string: MetaOapg.properties.map_of_enum_string direct_map: MetaOapg.properties.direct_map indirect_map: 'StringBooleanMap' + + @typing.overload + def __getitem__(self, name: typing.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["indirect_map"]) -> 'StringBooleanMap': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict, schemas.Unset] = schemas.unset, - map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict, schemas.Unset] = schemas.unset, - direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MapTest': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi new file mode 100644 index 00000000000..c15274fe1a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class MapTest( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class map_map_of_string( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'map_map_of_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class map_of_enum_string( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls("lower") + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_of_enum_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class direct_map( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'direct_map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + def indirect_map(cls) -> typing.Type['StringBooleanMap']: + return StringBooleanMap + __annotations__ = { + "map_map_of_string": map_map_of_string, + "map_of_enum_string": map_of_enum_string, + "direct_map": direct_map, + "indirect_map": indirect_map, + } + additional_properties = schemas.AnyTypeSchema + + map_map_of_string: MetaOapg.properties.map_map_of_string + map_of_enum_string: MetaOapg.properties.map_of_enum_string + direct_map: MetaOapg.properties.direct_map + indirect_map: 'StringBooleanMap' + + @typing.overload + def __getitem__(self, name: typing.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["indirect_map"]) -> 'StringBooleanMap': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MapTest': + return super().__new__( + cls, + *args, + map_map_of_string=map_map_of_string, + map_of_enum_string=map_of_enum_string, + direct_map=direct_map, + indirect_map=indirect_map, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 864d7b8095b..b07186ea010 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -51,10 +49,14 @@ class MixedPropertiesAndAdditionalPropertiesClass( @property def additional_properties(cls) -> typing.Type['Animal']: return Animal + + def __getitem__(self, name: str) -> 'Animal': + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: 'Animal', ) -> 'map': @@ -64,20 +66,38 @@ class MixedPropertiesAndAdditionalPropertiesClass( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "uuid": uuid, + "dateTime": dateTime, + "map": map, + } additional_properties = schemas.AnyTypeSchema uuid: MetaOapg.properties.uuid dateTime: MetaOapg.properties.dateTime map: MetaOapg.properties.map + + @typing.overload + def __getitem__(self, name: typing.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map"]) -> MetaOapg.properties.map: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], uuid: typing.Union[MetaOapg.properties.uuid, uuid.UUID, str, schemas.Unset] = schemas.unset, dateTime: typing.Union[MetaOapg.properties.dateTime, datetime, str, schemas.Unset] = schemas.unset, - map: typing.Union[MetaOapg.properties.map, dict, frozendict, schemas.Unset] = schemas.unset, + map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MixedPropertiesAndAdditionalPropertiesClass': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi new file mode 100644 index 00000000000..b07186ea010 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class MixedPropertiesAndAdditionalPropertiesClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + uuid = schemas.UUIDSchema + dateTime = schemas.DateTimeSchema + + + class map( + schemas.DictSchema + ): + + + class MetaOapg: + + @classmethod + @property + def additional_properties(cls) -> typing.Type['Animal']: + return Animal + + def __getitem__(self, name: str) -> 'Animal': + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: 'Animal', + ) -> 'map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "uuid": uuid, + "dateTime": dateTime, + "map": map, + } + additional_properties = schemas.AnyTypeSchema + + uuid: MetaOapg.properties.uuid + dateTime: MetaOapg.properties.dateTime + map: MetaOapg.properties.map + + @typing.overload + def __getitem__(self, name: typing.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["map"]) -> MetaOapg.properties.map: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + uuid: typing.Union[MetaOapg.properties.uuid, uuid.UUID, str, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, datetime, str, schemas.Unset] = schemas.unset, + map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MixedPropertiesAndAdditionalPropertiesClass': + return super().__new__( + cls, + *args, + uuid=uuid, + dateTime=dateTime, + map=map, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index b42718ce256..23f92295ea2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -40,29 +38,31 @@ class Model200Response( class properties: name = schemas.Int32Schema _class = schemas.StrSchema - locals()["class"] = _class - del locals()['_class'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + __annotations__ = { + "name": name, + "class": _class, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["class"]) -> MetaOapg.properties._class: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], name: typing.Union[MetaOapg.properties.name, int, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Model200Response': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi new file mode 100644 index 00000000000..23f92295ea2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Model200Response( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with an invalid class name for python, starts with a number + """ + + + class MetaOapg: + class properties: + name = schemas.Int32Schema + _class = schemas.StrSchema + __annotations__ = { + "name": name, + "class": _class, + } + additional_properties = schemas.AnyTypeSchema + + + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["class"]) -> MetaOapg.properties._class: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + name: typing.Union[MetaOapg.properties.name, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Model200Response': + return super().__new__( + cls, + *args, + name=name, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 2cdddc4063f..1c7c20083b3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,27 +37,25 @@ class ModelReturn( class MetaOapg: class properties: _return = schemas.Int32Schema - locals()["return"] = _return - del locals()['_return'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + __annotations__ = { + "return": _return, + } additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["return"]) -> MetaOapg.properties._return: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ModelReturn': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi new file mode 100644 index 00000000000..1c7c20083b3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ModelReturn( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing reserved words + """ + + + class MetaOapg: + class properties: + _return = schemas.Int32Schema + __annotations__ = { + "return": _return, + } + additional_properties = schemas.AnyTypeSchema + + + + @typing.overload + def __getitem__(self, name: typing.Literal["return"]) -> MetaOapg.properties._return: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ModelReturn': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py index 10db88117ce..698c10e26bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -46,18 +44,32 @@ class Money( @property def currency(cls) -> typing.Type['Currency']: return Currency + __annotations__ = { + "amount": amount, + "currency": currency, + } additional_properties = schemas.AnyTypeSchema amount: MetaOapg.properties.amount currency: 'Currency' + + @typing.overload + def __getitem__(self, name: typing.Literal["amount"]) -> MetaOapg.properties.amount: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["currency"]) -> 'Currency': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], amount: typing.Union[MetaOapg.properties.amount, str, ], currency: 'Currency', _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Money': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi new file mode 100644 index 00000000000..698c10e26bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Money( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "amount", + "currency", + } + class properties: + amount = schemas.DecimalSchema + + @classmethod + @property + def currency(cls) -> typing.Type['Currency']: + return Currency + __annotations__ = { + "amount": amount, + "currency": currency, + } + additional_properties = schemas.AnyTypeSchema + + amount: MetaOapg.properties.amount + currency: 'Currency' + + @typing.overload + def __getitem__(self, name: typing.Literal["amount"]) -> MetaOapg.properties.amount: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["currency"]) -> 'Currency': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + amount: typing.Union[MetaOapg.properties.amount, str, ], + currency: 'Currency', + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Money': + return super().__new__( + cls, + *args, + amount=amount, + currency=currency, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.currency import Currency diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 50fa7e22cb3..174b17ace82 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -44,31 +42,37 @@ class Name( name = schemas.Int32Schema snake_case = schemas.Int32Schema _property = schemas.StrSchema - locals()["property"] = _property - del locals()['_property'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + __annotations__ = { + "name": name, + "snake_case": snake_case, + "property": _property, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name snake_case: MetaOapg.properties.snake_case + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["property"]) -> MetaOapg.properties._property: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], name: typing.Union[MetaOapg.properties.name, int, ], snake_case: typing.Union[MetaOapg.properties.snake_case, int, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Name': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi new file mode 100644 index 00000000000..174b17ace82 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Name( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing model name same as property name + """ + + + class MetaOapg: + required = { + "name", + } + class properties: + name = schemas.Int32Schema + snake_case = schemas.Int32Schema + _property = schemas.StrSchema + __annotations__ = { + "name": name, + "snake_case": snake_case, + "property": _property, + } + additional_properties = schemas.AnyTypeSchema + + + name: MetaOapg.properties.name + snake_case: MetaOapg.properties.snake_case + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["property"]) -> MetaOapg.properties._property: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + name: typing.Union[MetaOapg.properties.name, int, ], + snake_case: typing.Union[MetaOapg.properties.snake_case, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Name': + return super().__new__( + cls, + *args, + name=name, + snake_case=snake_case, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py index c5cdbfc3617..5bf3c5d41a1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,14 +39,26 @@ class NoAdditionalProperties( class properties: id = schemas.Int64Schema petId = schemas.Int64Schema + __annotations__ = { + "id": id, + "petId": petId, + } additional_properties = None id: MetaOapg.properties.id petId: MetaOapg.properties.petId + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + def __getitem__(self, name: typing.Literal["petId"]) -> MetaOapg.properties.petId: + # dict_instance[name] accessor + return super().__getitem__(name) + def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], id: typing.Union[MetaOapg.properties.id, int, ], petId: typing.Union[MetaOapg.properties.petId, int, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi new file mode 100644 index 00000000000..5bf3c5d41a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NoAdditionalProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "id", + } + class properties: + id = schemas.Int64Schema + petId = schemas.Int64Schema + __annotations__ = { + "id": id, + "petId": petId, + } + additional_properties = None + + id: MetaOapg.properties.id + petId: MetaOapg.properties.petId + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + def __getitem__(self, name: typing.Literal["petId"]) -> MetaOapg.properties.petId: + # dict_instance[name] accessor + return super().__getitem__(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, int, ], + petId: typing.Union[MetaOapg.properties.petId, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'NoAdditionalProperties': + return super().__new__( + cls, + *args, + id=id, + petId=petId, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index bb1d12722d7..5d62571966d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -194,7 +192,7 @@ class NullableClass( class items( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -204,12 +202,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'items': return super().__new__( cls, @@ -240,7 +242,7 @@ class NullableClass( class items( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -250,12 +252,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'items': return super().__new__( cls, @@ -266,7 +272,7 @@ class NullableClass( def __new__( cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, None, ]]], + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'array_items_nullable': return super().__new__( @@ -275,12 +281,12 @@ class NullableClass( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) class object_nullable_prop( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -290,12 +296,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.DictSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], ) -> 'object_nullable_prop': return super().__new__( cls, @@ -306,7 +316,7 @@ class NullableClass( class object_and_items_nullable_prop( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -317,7 +327,7 @@ class NullableClass( class additional_properties( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -327,12 +337,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'additional_properties': return super().__new__( cls, @@ -341,12 +355,16 @@ class NullableClass( **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, None, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], ) -> 'object_and_items_nullable_prop': return super().__new__( cls, @@ -365,7 +383,7 @@ class NullableClass( class additional_properties( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -375,12 +393,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'additional_properties': return super().__new__( cls, @@ -388,12 +410,16 @@ class NullableClass( _configuration=_configuration, **kwargs, ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, None, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], ) -> 'object_items_nullable': return super().__new__( cls, @@ -401,10 +427,24 @@ class NullableClass( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "integer_prop": integer_prop, + "number_prop": number_prop, + "boolean_prop": boolean_prop, + "string_prop": string_prop, + "date_prop": date_prop, + "datetime_prop": datetime_prop, + "array_nullable_prop": array_nullable_prop, + "array_and_items_nullable_prop": array_and_items_nullable_prop, + "array_items_nullable": array_items_nullable, + "object_nullable_prop": object_nullable_prop, + "object_and_items_nullable_prop": object_and_items_nullable_prop, + "object_items_nullable": object_items_nullable, + } class additional_properties( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -414,12 +454,16 @@ class NullableClass( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'additional_properties': return super().__new__( cls, @@ -440,10 +484,50 @@ class NullableClass( object_nullable_prop: MetaOapg.properties.object_nullable_prop object_and_items_nullable_prop: MetaOapg.properties.object_and_items_nullable_prop object_items_nullable: MetaOapg.properties.object_items_nullable + + @typing.overload + def __getitem__(self, name: typing.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, int, schemas.Unset] = schemas.unset, number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, @@ -453,11 +537,11 @@ class NullableClass( array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, tuple, None, schemas.Unset] = schemas.unset, array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, tuple, None, schemas.Unset] = schemas.unset, array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, tuple, schemas.Unset] = schemas.unset, - object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict, None, schemas.Unset] = schemas.unset, - object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict, None, schemas.Unset] = schemas.unset, - object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict, schemas.Unset] = schemas.unset, + object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, None, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], ) -> 'NullableClass': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi new file mode 100644 index 00000000000..5d62571966d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi @@ -0,0 +1,563 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableClass( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class integer_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, decimal.Decimal, ]), + schemas.IntBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'integer_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class number_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, decimal.Decimal, ]), + schemas.NumberBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, decimal.Decimal, int, float, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'number_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class boolean_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, schemas.BoolClass, ]), + schemas.BoolBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, bool, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'boolean_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class string_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.StrBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'string_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class date_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.DateBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, date, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'date_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class datetime_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.DateTimeBase, + schemas.NoneBase, + schemas.Schema + ): + + + def __new__( + cls, + *args: typing.Union[None, datetime, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'datetime_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_nullable_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[tuple, schemas.NoneClass, ]), + schemas.ListBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + items = schemas.DictSchema + + + def __new__( + cls, + *args: typing.Union[tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_and_items_nullable_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[tuple, schemas.NoneClass, ]), + schemas.ListBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + + + class items( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'items': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_and_items_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_items_nullable( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'items': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_items_nullable': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class object_nullable_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.DictSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'object_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class object_and_items_nullable_prop( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'object_and_items_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class object_items_nullable( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'object_items_nullable': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "integer_prop": integer_prop, + "number_prop": number_prop, + "boolean_prop": boolean_prop, + "string_prop": string_prop, + "date_prop": date_prop, + "datetime_prop": datetime_prop, + "array_nullable_prop": array_nullable_prop, + "array_and_items_nullable_prop": array_and_items_nullable_prop, + "array_items_nullable": array_items_nullable, + "object_nullable_prop": object_nullable_prop, + "object_and_items_nullable_prop": object_and_items_nullable_prop, + "object_items_nullable": object_items_nullable, + } + + + class additional_properties( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + integer_prop: MetaOapg.properties.integer_prop + number_prop: MetaOapg.properties.number_prop + boolean_prop: MetaOapg.properties.boolean_prop + string_prop: MetaOapg.properties.string_prop + date_prop: MetaOapg.properties.date_prop + datetime_prop: MetaOapg.properties.datetime_prop + array_nullable_prop: MetaOapg.properties.array_nullable_prop + array_and_items_nullable_prop: MetaOapg.properties.array_and_items_nullable_prop + array_items_nullable: MetaOapg.properties.array_items_nullable + object_nullable_prop: MetaOapg.properties.object_nullable_prop + object_and_items_nullable_prop: MetaOapg.properties.object_and_items_nullable_prop + object_items_nullable: MetaOapg.properties.object_items_nullable + + @typing.overload + def __getitem__(self, name: typing.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, int, schemas.Unset] = schemas.unset, + number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, + string_prop: typing.Union[MetaOapg.properties.string_prop, None, str, schemas.Unset] = schemas.unset, + date_prop: typing.Union[MetaOapg.properties.date_prop, None, date, str, schemas.Unset] = schemas.unset, + datetime_prop: typing.Union[MetaOapg.properties.datetime_prop, None, datetime, str, schemas.Unset] = schemas.unset, + array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, tuple, None, schemas.Unset] = schemas.unset, + array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, tuple, None, schemas.Unset] = schemas.unset, + array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, tuple, schemas.Unset] = schemas.unset, + object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'NullableClass': + return super().__new__( + cls, + *args, + integer_prop=integer_prop, + number_prop=number_prop, + boolean_prop=boolean_prop, + string_prop=string_prop, + date_prop=date_prop, + datetime_prop=datetime_prop, + array_nullable_prop=array_nullable_prop, + array_and_items_nullable_prop=array_and_items_nullable_prop, + array_items_nullable=array_items_nullable, + object_nullable_prop=object_nullable_prop, + object_and_items_nullable_prop=object_and_items_nullable_prop, + object_items_nullable=object_items_nullable, + _configuration=_configuration, + **kwargs, + ) 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 9ef49b7ce29..e0bf0726e21 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -57,12 +55,16 @@ class NullableShape( cls.one_of_2, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NullableShape': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi new file mode 100644 index 00000000000..e0bf0726e21 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableShape( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + one_of_2 = schemas.NoneSchema + + @classmethod + @property + @functools.cache + def one_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 [ + Triangle, + Quadrilateral, + cls.one_of_2, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NullableShape': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py index 95eef2e85a2..fc243405ba8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi new file mode 100644 index 00000000000..fc243405ba8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NullableString( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.StrBase, + schemas.NoneBase, + schemas.Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'NullableString': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py index 8b1f3ee08cd..0c43507775b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 Number = schemas.NumberSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi new file mode 100644 index 00000000000..0c43507775b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +Number = schemas.NumberSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index 71fbdeb258b..484e816275b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,16 +35,26 @@ class NumberOnly( class MetaOapg: class properties: JustNumber = schemas.NumberSchema + __annotations__ = { + "JustNumber": JustNumber, + } additional_properties = schemas.AnyTypeSchema JustNumber: MetaOapg.properties.JustNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'NumberOnly': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi new file mode 100644 index 00000000000..484e816275b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NumberOnly( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + JustNumber = schemas.NumberSchema + __annotations__ = { + "JustNumber": JustNumber, + } + additional_properties = schemas.AnyTypeSchema + + JustNumber: MetaOapg.properties.JustNumber + + @typing.overload + def __getitem__(self, name: typing.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'NumberOnly': + return super().__new__( + cls, + *args, + JustNumber=JustNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 0266a5a2810..da9eb818522 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi new file mode 100644 index 00000000000..8c86d5fbf4b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class NumberWithValidations( + schemas.NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py index a60bb6fa706..e8a3ccb9ac6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 ObjectInterface = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi new file mode 100644 index 00000000000..e8a3ccb9ac6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +ObjectInterface = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 7918a7a9989..3fcfa144677 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -45,20 +43,38 @@ class ObjectModelWithRefProps( return NumberWithValidations myString = schemas.StrSchema myBoolean = schemas.BoolSchema + __annotations__ = { + "myNumber": myNumber, + "myString": myString, + "myBoolean": myBoolean, + } additional_properties = schemas.AnyTypeSchema myNumber: 'NumberWithValidations' myString: MetaOapg.properties.myString myBoolean: MetaOapg.properties.myBoolean + + @typing.overload + def __getitem__(self, name: typing.Literal["myNumber"]) -> 'NumberWithValidations': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["myString"]) -> MetaOapg.properties.myString: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectModelWithRefProps': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi new file mode 100644 index 00000000000..3fcfa144677 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectModelWithRefProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + """ + + + class MetaOapg: + class properties: + + @classmethod + @property + def myNumber(cls) -> typing.Type['NumberWithValidations']: + return NumberWithValidations + myString = schemas.StrSchema + myBoolean = schemas.BoolSchema + __annotations__ = { + "myNumber": myNumber, + "myString": myString, + "myBoolean": myBoolean, + } + additional_properties = schemas.AnyTypeSchema + + myNumber: 'NumberWithValidations' + myString: MetaOapg.properties.myString + myBoolean: MetaOapg.properties.myBoolean + + @typing.overload + def __getitem__(self, name: typing.Literal["myNumber"]) -> 'NumberWithValidations': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["myString"]) -> MetaOapg.properties.myString: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, + myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, + myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectModelWithRefProps': + return super().__new__( + cls, + *args, + myNumber=myNumber, + myString=myString, + myBoolean=myBoolean, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py index 173b9e10fdc..f52294761c0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -43,20 +41,38 @@ class ObjectWithDecimalProperties( @property def cost(cls) -> typing.Type['Money']: return Money + __annotations__ = { + "length": length, + "width": width, + "cost": cost, + } additional_properties = schemas.AnyTypeSchema length: MetaOapg.properties.length width: MetaOapg.properties.width cost: 'Money' + + @typing.overload + def __getitem__(self, name: typing.Literal["length"]) -> MetaOapg.properties.length: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["width"]) -> MetaOapg.properties.width: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["cost"]) -> 'Money': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], length: typing.Union[MetaOapg.properties.length, str, schemas.Unset] = schemas.unset, width: typing.Union[MetaOapg.properties.width, str, schemas.Unset] = schemas.unset, cost: typing.Union['Money', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectWithDecimalProperties': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi new file mode 100644 index 00000000000..f52294761c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithDecimalProperties( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + length = schemas.DecimalSchema + width = schemas.DecimalSchema + + @classmethod + @property + def cost(cls) -> typing.Type['Money']: + return Money + __annotations__ = { + "length": length, + "width": width, + "cost": cost, + } + additional_properties = schemas.AnyTypeSchema + + length: MetaOapg.properties.length + width: MetaOapg.properties.width + cost: 'Money' + + @typing.overload + def __getitem__(self, name: typing.Literal["length"]) -> MetaOapg.properties.length: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["width"]) -> MetaOapg.properties.width: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["cost"]) -> 'Money': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + length: typing.Union[MetaOapg.properties.length, str, schemas.Unset] = schemas.unset, + width: typing.Union[MetaOapg.properties.width, str, schemas.Unset] = schemas.unset, + cost: typing.Union['Money', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectWithDecimalProperties': + return super().__new__( + cls, + *args, + length=length, + width=width, + cost=cost, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.money import Money diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py index d021497894b..d3f329418bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,53 +39,35 @@ class ObjectWithDifficultlyNamedProps( "123-list", } class properties: - special_property_name = schemas.Int64Schema - locals()["$special[property.name]"] = special_property_name - del locals()['special_property_name'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ _123_list = schemas.StrSchema - locals()["123-list"] = _123_list - del locals()['_123_list'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + special_property_name = schemas.Int64Schema _123_number = schemas.IntSchema - locals()["123Number"] = _123_number - del locals()['_123_number'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ + __annotations__ = { + "123-list": _123_list, + "$special[property.name]": special_property_name, + "123Number": _123_number, + } additional_properties = schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing.Literal["123-list"]) -> MetaOapg.properties._123_list: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["$special[property.name]"]) -> MetaOapg.properties.special_property_name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["123Number"]) -> MetaOapg.properties._123_number: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectWithDifficultlyNamedProps': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi new file mode 100644 index 00000000000..d3f329418bb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithDifficultlyNamedProps( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with properties that have invalid names for python + """ + + + class MetaOapg: + required = { + "123-list", + } + class properties: + _123_list = schemas.StrSchema + special_property_name = schemas.Int64Schema + _123_number = schemas.IntSchema + __annotations__ = { + "123-list": _123_list, + "$special[property.name]": special_property_name, + "123Number": _123_number, + } + additional_properties = schemas.AnyTypeSchema + + + @typing.overload + def __getitem__(self, name: typing.Literal["123-list"]) -> MetaOapg.properties._123_list: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["$special[property.name]"]) -> MetaOapg.properties.special_property_name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["123Number"]) -> MetaOapg.properties._123_number: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectWithDifficultlyNamedProps': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 4478e77a313..7255a14e602 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -70,12 +68,16 @@ class ObjectWithInlineCompositionProperty( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'someProp': return super().__new__( cls, @@ -83,16 +85,26 @@ class ObjectWithInlineCompositionProperty( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "someProp": someProp, + } additional_properties = schemas.AnyTypeSchema someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectWithInlineCompositionProperty': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi new file mode 100644 index 00000000000..3a9e9286429 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithInlineCompositionProperty( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + + + class someProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, 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, + } + additional_properties = schemas.AnyTypeSchema + + someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectWithInlineCompositionProperty': + return super().__new__( + cls, + *args, + someProp=someProp, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py index 787d31cab05..c817c91de4d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -37,12 +35,16 @@ class ObjectWithValidations( class MetaOapg: additional_properties = schemas.AnyTypeSchema min_properties = 2 + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ObjectWithValidations': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi new file mode 100644 index 00000000000..af0c6615376 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithValidations( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ObjectWithValidations': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index da9f4682623..c68f395ca25 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -68,6 +66,14 @@ class Order( def DELIVERED(cls): return cls("delivered") complete = schemas.BoolSchema + __annotations__ = { + "id": id, + "petId": petId, + "quantity": quantity, + "shipDate": shipDate, + "status": status, + "complete": complete, + } additional_properties = schemas.AnyTypeSchema id: MetaOapg.properties.id @@ -76,10 +82,32 @@ class Order( shipDate: MetaOapg.properties.shipDate status: MetaOapg.properties.status complete: MetaOapg.properties.complete + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["petId"]) -> MetaOapg.properties.petId: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["quantity"]) -> MetaOapg.properties.quantity: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["complete"]) -> MetaOapg.properties.complete: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, petId: typing.Union[MetaOapg.properties.petId, int, schemas.Unset] = schemas.unset, quantity: typing.Union[MetaOapg.properties.quantity, int, schemas.Unset] = schemas.unset, @@ -87,7 +115,7 @@ class Order( status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Order': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi new file mode 100644 index 00000000000..c68f395ca25 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Order( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + id = schemas.Int64Schema + petId = schemas.Int64Schema + quantity = schemas.Int32Schema + shipDate = schemas.DateTimeSchema + + + class status( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def PLACED(cls): + return cls("placed") + + @classmethod + @property + def APPROVED(cls): + return cls("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls("delivered") + complete = schemas.BoolSchema + __annotations__ = { + "id": id, + "petId": petId, + "quantity": quantity, + "shipDate": shipDate, + "status": status, + "complete": complete, + } + additional_properties = schemas.AnyTypeSchema + + id: MetaOapg.properties.id + petId: MetaOapg.properties.petId + quantity: MetaOapg.properties.quantity + shipDate: MetaOapg.properties.shipDate + status: MetaOapg.properties.status + complete: MetaOapg.properties.complete + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["petId"]) -> MetaOapg.properties.petId: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["quantity"]) -> MetaOapg.properties.quantity: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["complete"]) -> MetaOapg.properties.complete: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, + petId: typing.Union[MetaOapg.properties.petId, int, schemas.Unset] = schemas.unset, + quantity: typing.Union[MetaOapg.properties.quantity, int, schemas.Unset] = schemas.unset, + shipDate: typing.Union[MetaOapg.properties.shipDate, datetime, str, schemas.Unset] = schemas.unset, + status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, + complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Order': + return super().__new__( + cls, + *args, + id=id, + petId=petId, + quantity=quantity, + shipDate=shipDate, + status=status, + complete=complete, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index f68b5ec8fb3..1e35ba8ce9a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -62,12 +60,16 @@ class ParentPet( GrandparentAnimal, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ParentPet': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi new file mode 100644 index 00000000000..1e35ba8ce9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ParentPet( + schemas.ComposedBase, + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'pet_type': { + 'ChildCat': ChildCat, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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 [ + GrandparentAnimal, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ParentPet': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 4ba21ef25a6..94c9a22ddb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -42,12 +40,6 @@ class Pet( "name", } class properties: - id = schemas.Int64Schema - - @classmethod - @property - def category(cls) -> typing.Type['Category']: - return Category name = schemas.StrSchema @@ -70,8 +62,14 @@ class Pet( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + id = schemas.Int64Schema + + @classmethod + @property + def category(cls) -> typing.Type['Category']: + return Category class tags( @@ -97,7 +95,7 @@ class Pet( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Tag': return super().__getitem__(i) @@ -126,6 +124,14 @@ class Pet( @property def SOLD(cls): return cls("sold") + __annotations__ = { + "name": name, + "photoUrls": photoUrls, + "id": id, + "category": category, + "tags": tags, + "status": status, + } additional_properties = schemas.AnyTypeSchema photoUrls: MetaOapg.properties.photoUrls @@ -134,10 +140,32 @@ class Pet( category: 'Category' tags: MetaOapg.properties.tags status: MetaOapg.properties.status + + @typing.overload + def __getitem__(self, name: typing.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["category"]) -> 'Category': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["tags"]) -> MetaOapg.properties.tags: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], photoUrls: typing.Union[MetaOapg.properties.photoUrls, tuple, ], name: typing.Union[MetaOapg.properties.name, str, ], id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, @@ -145,7 +173,7 @@ class Pet( tags: typing.Union[MetaOapg.properties.tags, tuple, schemas.Unset] = schemas.unset, status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Pet': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi new file mode 100644 index 00000000000..94c9a22ddb5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Pet( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Pet object that needs to be added to the store + """ + + + class MetaOapg: + required = { + "photoUrls", + "name", + } + class properties: + name = schemas.StrSchema + + + class photoUrls( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'photoUrls': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + id = schemas.Int64Schema + + @classmethod + @property + def category(cls) -> typing.Type['Category']: + return Category + + + class tags( + schemas.ListSchema + ): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Tag']: + return Tag + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Tag'], typing.List['Tag']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'tags': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Tag': + return super().__getitem__(i) + + + class status( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def AVAILABLE(cls): + return cls("available") + + @classmethod + @property + def PENDING(cls): + return cls("pending") + + @classmethod + @property + def SOLD(cls): + return cls("sold") + __annotations__ = { + "name": name, + "photoUrls": photoUrls, + "id": id, + "category": category, + "tags": tags, + "status": status, + } + additional_properties = schemas.AnyTypeSchema + + photoUrls: MetaOapg.properties.photoUrls + name: MetaOapg.properties.name + id: MetaOapg.properties.id + category: 'Category' + tags: MetaOapg.properties.tags + status: MetaOapg.properties.status + + @typing.overload + def __getitem__(self, name: typing.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["category"]) -> 'Category': ... + + @typing.overload + def __getitem__(self, name: typing.Literal["tags"]) -> MetaOapg.properties.tags: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + photoUrls: typing.Union[MetaOapg.properties.photoUrls, tuple, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, + category: typing.Union['Category', schemas.Unset] = schemas.unset, + tags: typing.Union[MetaOapg.properties.tags, tuple, schemas.Unset] = schemas.unset, + status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Pet': + return super().__new__( + cls, + *args, + photoUrls=photoUrls, + name=name, + id=id, + category=category, + tags=tags, + status=status, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.category import Category +from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index a4a578563bf..1216de8434a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -63,12 +61,16 @@ class Pig( DanishPig, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Pig': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi new file mode 100644 index 00000000000..1216de8434a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Pig( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'className': { + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + BasquePig, + DanishPig, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Pig': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py index 15f7155b007..67e6436fa60 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -44,18 +42,32 @@ class Player( @property def enemyPlayer(cls) -> typing.Type['Player']: return Player + __annotations__ = { + "name": name, + "enemyPlayer": enemyPlayer, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name enemyPlayer: 'Player' + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enemyPlayer"]) -> 'Player': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, enemyPlayer: typing.Union['Player', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Player': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi new file mode 100644 index 00000000000..67e6436fa60 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Player( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties + """ + + + class MetaOapg: + class properties: + name = schemas.StrSchema + + @classmethod + @property + def enemyPlayer(cls) -> typing.Type['Player']: + return Player + __annotations__ = { + "name": name, + "enemyPlayer": enemyPlayer, + } + additional_properties = schemas.AnyTypeSchema + + name: MetaOapg.properties.name + enemyPlayer: 'Player' + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enemyPlayer"]) -> 'Player': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + enemyPlayer: typing.Union['Player', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Player': + return super().__new__( + cls, + *args, + name=name, + enemyPlayer=enemyPlayer, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index ea6a61302d0..036e3bca5dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -63,12 +61,16 @@ class Quadrilateral( ComplexQuadrilateral, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Quadrilateral': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi new file mode 100644 index 00000000000..036e3bca5dd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Quadrilateral( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'quadrilateralType': { + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + SimpleQuadrilateral, + ComplexQuadrilateral, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Quadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index dbaae6c72e3..de0d8b1d940 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -56,19 +54,33 @@ class QuadrilateralInterface( def QUADRILATERAL(cls): return cls("Quadrilateral") quadrilateralType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "quadrilateralType": quadrilateralType, + } additional_properties = schemas.AnyTypeSchema shapeType: MetaOapg.properties.shapeType quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'QuadrilateralInterface': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi new file mode 100644 index 00000000000..de0d8b1d940 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class QuadrilateralInterface( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "shapeType", + "quadrilateralType", + } + class properties: + + + class shapeType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "Quadrilateral": "QUADRILATERAL", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def QUADRILATERAL(cls): + return cls("Quadrilateral") + quadrilateralType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "quadrilateralType": quadrilateralType, + } + additional_properties = schemas.AnyTypeSchema + + + shapeType: MetaOapg.properties.shapeType + quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'QuadrilateralInterface': + return super().__new__( + cls, + *args, + shapeType=shapeType, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 7da7c264cb8..73d6a684eee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -38,18 +36,32 @@ class ReadOnlyFirst( class properties: bar = schemas.StrSchema baz = schemas.StrSchema + __annotations__ = { + "bar": bar, + "baz": baz, + } additional_properties = schemas.AnyTypeSchema bar: MetaOapg.properties.bar baz: MetaOapg.properties.baz + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ReadOnlyFirst': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi new file mode 100644 index 00000000000..73d6a684eee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ReadOnlyFirst( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + bar = schemas.StrSchema + baz = schemas.StrSchema + __annotations__ = { + "bar": bar, + "baz": baz, + } + additional_properties = schemas.AnyTypeSchema + + bar: MetaOapg.properties.bar + baz: MetaOapg.properties.baz + + @typing.overload + def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ReadOnlyFirst': + return super().__new__( + cls, + *args, + bar=bar, + baz=baz, + _configuration=_configuration, + **kwargs, + ) 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 5789f690ca7..8994382dfa3 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,16 +58,26 @@ class ScaleneTriangle( @property def SCALENE_TRIANGLE(cls): return cls("ScaleneTriangle") + __annotations__ = { + "triangleType": triangleType, + } additional_properties = schemas.AnyTypeSchema triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -95,12 +103,16 @@ class ScaleneTriangle( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ScaleneTriangle': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi new file mode 100644 index 00000000000..8994382dfa3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ScaleneTriangle( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + + + class triangleType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "ScaleneTriangle": "SCALENE_TRIANGLE", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def SCALENE_TRIANGLE(cls): + return cls("ScaleneTriangle") + __annotations__ = { + "triangleType": triangleType, + } + additional_properties = schemas.AnyTypeSchema + + triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + TriangleInterface, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ScaleneTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 6635f10c1c2..e6ae4e187e2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -63,12 +61,16 @@ class Shape( Quadrilateral, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Shape': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi new file mode 100644 index 00000000000..e6ae4e187e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Shape( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + Triangle, + Quadrilateral, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Shape': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle 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 cc0529a55d9..97438cab005 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -67,12 +65,16 @@ class ShapeOrNull( Quadrilateral, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'ShapeOrNull': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi new file mode 100644 index 00000000000..97438cab005 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ShapeOrNull( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + additional_properties = schemas.AnyTypeSchema + one_of_0 = schemas.NoneSchema + + @classmethod + @property + @functools.cache + def one_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.one_of_0, + Triangle, + Quadrilateral, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'ShapeOrNull': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle 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 3946f6332db..fd4a42a47f3 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -60,16 +58,26 @@ class SimpleQuadrilateral( @property def SIMPLE_QUADRILATERAL(cls): return cls("SimpleQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } additional_properties = schemas.AnyTypeSchema quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'all_of_1': return super().__new__( cls, @@ -95,12 +103,16 @@ class SimpleQuadrilateral( cls.all_of_1, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SimpleQuadrilateral': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi new file mode 100644 index 00000000000..fd4a42a47f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SimpleQuadrilateral( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + class properties: + + + class quadrilateralType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "SimpleQuadrilateral": "SIMPLE_QUADRILATERAL", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def SIMPLE_QUADRILATERAL(cls): + return cls("SimpleQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } + additional_properties = schemas.AnyTypeSchema + + quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @property + @functools.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 [ + QuadrilateralInterface, + cls.all_of_1, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SimpleQuadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py index e0922b6105c..59231c14e47 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -52,12 +50,16 @@ class SomeObject( ObjectInterface, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SomeObject': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi new file mode 100644 index 00000000000..59231c14e47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SomeObject( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.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 [ + ObjectInterface, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SomeObject': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 37296b3998b..d94c5fb5433 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,16 +37,26 @@ class SpecialModelName( class MetaOapg: class properties: a = schemas.StrSchema + __annotations__ = { + "a": a, + } additional_properties = schemas.AnyTypeSchema a: MetaOapg.properties.a + + @typing.overload + def __getitem__(self, name: typing.Literal["a"]) -> MetaOapg.properties.a: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SpecialModelName': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi new file mode 100644 index 00000000000..d94c5fb5433 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class SpecialModelName( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with an invalid class name for python + """ + + + class MetaOapg: + class properties: + a = schemas.StrSchema + __annotations__ = { + "a": a, + } + additional_properties = schemas.AnyTypeSchema + + a: MetaOapg.properties.a + + @typing.overload + def __getitem__(self, name: typing.Literal["a"]) -> MetaOapg.properties.a: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SpecialModelName': + return super().__new__( + cls, + *args, + a=a, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py index d21adb97f8a..fa7554dd9ef 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py @@ -10,16 +10,14 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 String = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi new file mode 100644 index 00000000000..fa7554dd9ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi @@ -0,0 +1,23 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 +String = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 4e797764672..353a8fe86be 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -36,10 +34,14 @@ class StringBooleanMap( class MetaOapg: additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], ) -> 'StringBooleanMap': diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi new file mode 100644 index 00000000000..353a8fe86be --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringBooleanMap( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'StringBooleanMap': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 26999f08c63..227fcdce346 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi new file mode 100644 index 00000000000..227fcdce346 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringEnum( + schemas.SchemaTypeCheckerClsFactory(typing.Union[schemas.NoneClass, str, ]), + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + schemas.NoneClass.NONE: "NONE", + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + "single quoted": "SINGLE_QUOTED", + "multiple\nlines": "MULTIPLE_LINES", + "double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE", + } + ), + schemas.StrBase, + schemas.NoneBase, + schemas.Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def NONE(cls): + return cls(None) + + @classmethod + @property + def PLACED(cls): + return cls("placed") + + @classmethod + @property + def APPROVED(cls): + return cls("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls("delivered") + + @classmethod + @property + def SINGLE_QUOTED(cls): + return cls("single quoted") + + @classmethod + @property + def MULTIPLE_LINES(cls): + return cls("multiple\nlines") + + @classmethod + @property + def DOUBLE_QUOTE_WITH_NEWLINE(cls): + return cls("double quote \n with newline") + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'StringEnum': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 6c5f36cd1e9..e252dc79d47 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi new file mode 100644 index 00000000000..e252dc79d47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringEnumWithDefaultValue( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + ), + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def PLACED(cls): + return cls("placed") + + @classmethod + @property + def APPROVED(cls): + return cls("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls("delivered") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py index 2bbaa66d70e..4d56955a0c3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi new file mode 100644 index 00000000000..8a90bed3850 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class StringWithValidation( + schemas.StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index 8dfcc2e891b..399093a2c44 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -38,18 +36,32 @@ class Tag( class properties: id = schemas.Int64Schema name = schemas.StrSchema + __annotations__ = { + "id": id, + "name": name, + } additional_properties = schemas.AnyTypeSchema id: MetaOapg.properties.id name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Tag': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi new file mode 100644 index 00000000000..399093a2c44 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Tag( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + id = schemas.Int64Schema + name = schemas.StrSchema + __annotations__ = { + "id": id, + "name": name, + } + additional_properties = schemas.AnyTypeSchema + + id: MetaOapg.properties.id + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Tag': + return super().__new__( + cls, + *args, + id=id, + name=name, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index fbb348a1493..a058e632443 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -65,12 +63,16 @@ class Triangle( ScaleneTriangle, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Triangle': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi new file mode 100644 index 00000000000..a058e632443 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Triangle( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + @classmethod + @property + def discriminator(cls): + return { + 'triangleType': { + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, + } + } + additional_properties = schemas.AnyTypeSchema + + @classmethod + @property + @functools.cache + def one_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 [ + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, + ] + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Triangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index e0bc1dcf0c7..1dc51df588b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -56,19 +54,33 @@ class TriangleInterface( def TRIANGLE(cls): return cls("Triangle") triangleType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "triangleType": triangleType, + } additional_properties = schemas.AnyTypeSchema shapeType: MetaOapg.properties.shapeType triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'TriangleInterface': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi new file mode 100644 index 00000000000..1dc51df588b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class TriangleInterface( + schemas.AnyTypeSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "shapeType", + "triangleType", + } + class properties: + + + class shapeType( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "Triangle": "TRIANGLE", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def TRIANGLE(cls): + return cls("Triangle") + triangleType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "triangleType": triangleType, + } + additional_properties = schemas.AnyTypeSchema + + + shapeType: MetaOapg.properties.shapeType + triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'TriangleInterface': + return super().__new__( + cls, + *args, + shapeType=shapeType, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) 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 40a93671f2f..107de8b5829 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 @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -48,7 +46,7 @@ class User( class objectWithNoDeclaredPropsNullable( - schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict, schemas.NoneClass, ]), + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), schemas.DictBase, schemas.NoneBase, schemas.Schema @@ -58,12 +56,16 @@ class User( class MetaOapg: additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, None, ], + *args: typing.Union[dict, frozendict.frozendict, None, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'objectWithNoDeclaredPropsNullable': return super().__new__( cls, @@ -83,12 +85,16 @@ class User( additional_properties = schemas.AnyTypeSchema not_schema = schemas.NoneSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'anyTypeExceptNullProp': return super().__new__( cls, @@ -97,6 +103,21 @@ class User( **kwargs, ) anyTypePropNullable = schemas.AnyTypeSchema + __annotations__ = { + "id": id, + "username": username, + "firstName": firstName, + "lastName": lastName, + "email": email, + "password": password, + "phone": phone, + "userStatus": userStatus, + "objectWithNoDeclaredProps": objectWithNoDeclaredProps, + "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, + "anyTypeProp": anyTypeProp, + "anyTypeExceptNullProp": anyTypeExceptNullProp, + "anyTypePropNullable": anyTypePropNullable, + } additional_properties = schemas.AnyTypeSchema id: MetaOapg.properties.id @@ -112,10 +133,53 @@ class User( anyTypeProp: MetaOapg.properties.anyTypeProp anyTypeExceptNullProp: MetaOapg.properties.anyTypeExceptNullProp anyTypePropNullable: MetaOapg.properties.anyTypePropNullable + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["username"]) -> MetaOapg.properties.username: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["firstName"]) -> MetaOapg.properties.firstName: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["lastName"]) -> MetaOapg.properties.lastName: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["email"]) -> MetaOapg.properties.email: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["phone"]) -> MetaOapg.properties.phone: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, @@ -124,13 +188,13 @@ class User( password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, userStatus: typing.Union[MetaOapg.properties.userStatus, int, schemas.Unset] = schemas.unset, - objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict, schemas.Unset] = schemas.unset, - objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict, None, schemas.Unset] = schemas.unset, - anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'User': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi new file mode 100644 index 00000000000..107de8b5829 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class User( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + class properties: + id = schemas.Int64Schema + username = schemas.StrSchema + firstName = schemas.StrSchema + lastName = schemas.StrSchema + email = schemas.StrSchema + password = schemas.StrSchema + phone = schemas.StrSchema + userStatus = schemas.Int32Schema + objectWithNoDeclaredProps = schemas.DictSchema + + + class objectWithNoDeclaredPropsNullable( + schemas.SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict, schemas.NoneClass, ]), + schemas.DictBase, + schemas.NoneBase, + schemas.Schema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'objectWithNoDeclaredPropsNullable': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + anyTypeProp = schemas.AnyTypeSchema + + + class anyTypeExceptNullProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + not_schema = schemas.NoneSchema + + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'anyTypeExceptNullProp': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + anyTypePropNullable = schemas.AnyTypeSchema + __annotations__ = { + "id": id, + "username": username, + "firstName": firstName, + "lastName": lastName, + "email": email, + "password": password, + "phone": phone, + "userStatus": userStatus, + "objectWithNoDeclaredProps": objectWithNoDeclaredProps, + "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, + "anyTypeProp": anyTypeProp, + "anyTypeExceptNullProp": anyTypeExceptNullProp, + "anyTypePropNullable": anyTypePropNullable, + } + additional_properties = schemas.AnyTypeSchema + + id: MetaOapg.properties.id + username: MetaOapg.properties.username + firstName: MetaOapg.properties.firstName + lastName: MetaOapg.properties.lastName + email: MetaOapg.properties.email + password: MetaOapg.properties.password + phone: MetaOapg.properties.phone + userStatus: MetaOapg.properties.userStatus + objectWithNoDeclaredProps: MetaOapg.properties.objectWithNoDeclaredProps + objectWithNoDeclaredPropsNullable: MetaOapg.properties.objectWithNoDeclaredPropsNullable + anyTypeProp: MetaOapg.properties.anyTypeProp + anyTypeExceptNullProp: MetaOapg.properties.anyTypeExceptNullProp + anyTypePropNullable: MetaOapg.properties.anyTypePropNullable + + @typing.overload + def __getitem__(self, name: typing.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["username"]) -> MetaOapg.properties.username: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["firstName"]) -> MetaOapg.properties.firstName: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["lastName"]) -> MetaOapg.properties.lastName: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["email"]) -> MetaOapg.properties.email: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["phone"]) -> MetaOapg.properties.phone: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, int, schemas.Unset] = schemas.unset, + username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, + firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, + lastName: typing.Union[MetaOapg.properties.lastName, str, schemas.Unset] = schemas.unset, + email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, + password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, + phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, + userStatus: typing.Union[MetaOapg.properties.userStatus, int, schemas.Unset] = schemas.unset, + objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'User': + return super().__new__( + cls, + *args, + id=id, + username=username, + firstName=firstName, + lastName=lastName, + email=email, + password=password, + phone=phone, + userStatus=userStatus, + objectWithNoDeclaredProps=objectWithNoDeclaredProps, + objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, + anyTypeProp=anyTypeProp, + anyTypeExceptNullProp=anyTypeExceptNullProp, + anyTypePropNullable=anyTypePropNullable, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py index 358ee1b8249..aaed8085fef 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi new file mode 100644 index 00000000000..ebc56367a20 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class UUIDString( + schemas.UUIDSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index e3ac411e183..b5f2ef31367 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -39,8 +37,6 @@ class Whale( "className", } class properties: - hasBaleen = schemas.BoolSchema - hasTeeth = schemas.BoolSchema class className( @@ -56,20 +52,40 @@ class Whale( @property def WHALE(cls): return cls("whale") + hasBaleen = schemas.BoolSchema + hasTeeth = schemas.BoolSchema + __annotations__ = { + "className": className, + "hasBaleen": hasBaleen, + "hasTeeth": hasTeeth, + } additional_properties = schemas.AnyTypeSchema className: MetaOapg.properties.className hasBaleen: MetaOapg.properties.hasBaleen hasTeeth: MetaOapg.properties.hasTeeth + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], className: typing.Union[MetaOapg.properties.className, str, ], hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Whale': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi new file mode 100644 index 00000000000..b5f2ef31367 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Whale( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "className", + } + class properties: + + + class className( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "whale": "WHALE", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def WHALE(cls): + return cls("whale") + hasBaleen = schemas.BoolSchema + hasTeeth = schemas.BoolSchema + __annotations__ = { + "className": className, + "hasBaleen": hasBaleen, + "hasTeeth": hasTeeth, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + hasBaleen: MetaOapg.properties.hasBaleen + hasTeeth: MetaOapg.properties.hasTeeth + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, + hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Whale': + return super().__new__( + cls, + *args, + className=className, + hasBaleen=hasBaleen, + hasTeeth=hasTeeth, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index 02a5f9336aa..03632b07bee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -10,17 +10,15 @@ """ import re # noqa: F401 -import sys # noqa: F401 import typing # noqa: F401 import functools # noqa: F401 -from frozendict import frozendict # noqa: F401 - import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 @@ -41,6 +39,21 @@ class Zebra( class properties: + class className( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "zebra": "ZEBRA", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def ZEBRA(cls): + return cls("zebra") + + class type( schemas.SchemaEnumMakerClsFactory( enum_value_to_name={ @@ -66,33 +79,32 @@ class Zebra( @property def GREVYS(cls): return cls("grevys") - - - class className( - schemas.SchemaEnumMakerClsFactory( - enum_value_to_name={ - "zebra": "ZEBRA", - } - ), - schemas.StrSchema - ): - - @classmethod - @property - def ZEBRA(cls): - return cls("zebra") + __annotations__ = { + "className": className, + "type": type, + } additional_properties = schemas.AnyTypeSchema className: MetaOapg.properties.className type: MetaOapg.properties.type + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["type"]) -> MetaOapg.properties.type: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], className: typing.Union[MetaOapg.properties.className, str, ], type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'Zebra': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi new file mode 100644 index 00000000000..03632b07bee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import typing # noqa: F401 +import functools # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class Zebra( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "className", + } + class properties: + + + class className( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "zebra": "ZEBRA", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def ZEBRA(cls): + return cls("zebra") + + + class type( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "plains": "PLAINS", + "mountain": "MOUNTAIN", + "grevys": "GREVYS", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def PLAINS(cls): + return cls("plains") + + @classmethod + @property + def MOUNTAIN(cls): + return cls("mountain") + + @classmethod + @property + def GREVYS(cls): + return cls("grevys") + __annotations__ = { + "className": className, + "type": type, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + type: MetaOapg.properties.type + + @typing.overload + def __getitem__(self, name: typing.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["type"]) -> MetaOapg.properties.type: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'Zebra': + return super().__new__( + cls, + *args, + className=className, + type=type, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py index c3b61015b92..c6b6bd3ae21 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi new file mode 100644 index 00000000000..44716cf521f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client +SchemaFor200ResponseBodyApplicationJson = Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py index 0432cd172fe..b5dc63cf0ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi new file mode 100644 index 00000000000..44716cf521f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client +SchemaFor200ResponseBodyApplicationJson = Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.py index 7634d6fae1f..520f4194ab4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -80,18 +81,6 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( class MetaOapg: inclusive_maximum = 987.6 - locals()["float"] = _float - del locals()['_float'] - """ - NOTE: - openapi/json-schema allows properties to have invalid python names - The above local assignment allows the code to keep those invalid python names - This allows properties to have names like 'some-name', '1 bad name' - Properties with these names are omitted from the __new__ + _from_openapi_data signatures - - __new__ these properties can be passed in as **kwargs - - _from_openapi_data these are passed in in a dict in the first positional argument *arg - If the property is required and was not passed in, an exception will be thrown - """ class double( @@ -142,6 +131,22 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( 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, + } additional_properties = schemas.AnyTypeSchema number: MetaOapg.properties.number @@ -157,10 +162,56 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( dateTime: MetaOapg.properties.dateTime password: MetaOapg.properties.password callback: MetaOapg.properties.callback + + @typing.overload + def __getitem__(self, name: typing.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["callback"]) -> MetaOapg.properties.callback: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *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, ], @@ -175,7 +226,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( 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[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, @@ -241,7 +292,7 @@ class BaseApi(api_client.Api): def _endpoint_parameters( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -300,7 +351,7 @@ class EndpointParameters(BaseApi): def endpoint_parameters( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -322,7 +373,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.pyi new file mode 100644 index 00000000000..01856e169d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_1/post.pyi @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + 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, + } + additional_properties = schemas.AnyTypeSchema + + number: MetaOapg.properties.number + pattern_without_delimiter: MetaOapg.properties.pattern_without_delimiter + byte: MetaOapg.properties.byte + double: MetaOapg.properties.double + integer: MetaOapg.properties.integer + int32: MetaOapg.properties.int32 + int64: MetaOapg.properties.int64 + string: MetaOapg.properties.string + binary: MetaOapg.properties.binary + date: MetaOapg.properties.date + dateTime: MetaOapg.properties.dateTime + password: MetaOapg.properties.password + callback: MetaOapg.properties.callback + + @typing.overload + def __getitem__(self, name: typing.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["pattern_without_delimiter"]) -> MetaOapg.properties.pattern_without_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["callback"]) -> MetaOapg.properties.callback: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, float, ], + integer: typing.Union[MetaOapg.properties.integer, int, schemas.Unset] = schemas.unset, + int32: typing.Union[MetaOapg.properties.int32, int, schemas.Unset] = schemas.unset, + int64: typing.Union[MetaOapg.properties.int64, int, schemas.Unset] = schemas.unset, + string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, + binary: typing.Union[MetaOapg.properties.binary, schemas.Unset] = schemas.unset, + date: typing.Union[MetaOapg.properties.date, date, str, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, datetime, str, 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[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': + 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, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.py index 5bb07223d55..167f03d9499 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -66,7 +67,7 @@ class EnumQueryStringArraySchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -224,7 +225,7 @@ class EnumHeaderStringArraySchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -333,7 +334,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -362,18 +363,32 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( @property def XYZ(cls): return cls("(xyz)") + __annotations__ = { + "enum_form_string_array": enum_form_string_array, + "enum_form_string": enum_form_string, + } additional_properties = schemas.AnyTypeSchema enum_form_string_array: MetaOapg.properties.enum_form_string_array enum_form_string: MetaOapg.properties.enum_form_string + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, 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[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, @@ -425,9 +440,9 @@ class BaseApi(api_client.Api): def _enum_parameters( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -512,9 +527,9 @@ class EnumParameters(BaseApi): def enum_parameters( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -538,9 +553,9 @@ class ApiForget(BaseApi): def get( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.pyi new file mode 100644 index 00000000000..b6bd7ad551a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_2/get.pyi @@ -0,0 +1,324 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params + + +class EnumQueryStringArraySchema( + schemas.ListSchema +): + + + class MetaOapg: + + + class items( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls(">") + + @classmethod + @property + 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, + ) -> 'EnumQueryStringArraySchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class EnumQueryStringSchema( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + schemas.StrSchema +): + + @classmethod + @property + def _ABC(cls): + return cls("_abc") + + @classmethod + @property + def EFG(cls): + return cls("-efg") + + @classmethod + @property + def XYZ(cls): + return cls("(xyz)") + + +class EnumQueryIntegerSchema( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1: "POSITIVE_1", + -2: "NEGATIVE_2", + } + ), + schemas.Int32Schema +): + + @classmethod + @property + def POSITIVE_1(cls): + return cls(1) + + @classmethod + @property + def NEGATIVE_2(cls): + return cls(-2) + + +class EnumQueryDoubleSchema( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + ), + schemas.Float64Schema +): + + @classmethod + @property + def POSITIVE_1_PT_1(cls): + return cls(1.1) + + @classmethod + @property + def NEGATIVE_1_PT_2(cls): + return cls(-1.2) +# header params + + +class EnumHeaderStringArraySchema( + schemas.ListSchema +): + + + class MetaOapg: + + + class items( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls(">") + + @classmethod + @property + 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, + ) -> 'EnumHeaderStringArraySchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class EnumHeaderStringSchema( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + schemas.StrSchema +): + + @classmethod + @property + def _ABC(cls): + return cls("_abc") + + @classmethod + @property + def EFG(cls): + return cls("-efg") + + @classmethod + @property + def XYZ(cls): + return cls("(xyz)") +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + + + class enum_form_string_array( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls(">") + + @classmethod + @property + 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.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def _ABC(cls): + return cls("_abc") + + @classmethod + @property + def EFG(cls): + return cls("-efg") + + @classmethod + @property + def XYZ(cls): + return cls("(xyz)") + __annotations__ = { + "enum_form_string_array": enum_form_string_array, + "enum_form_string": enum_form_string, + } + additional_properties = schemas.AnyTypeSchema + + enum_form_string_array: MetaOapg.properties.enum_form_string_array + enum_form_string: MetaOapg.properties.enum_form_string + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_form_string_array"]) -> MetaOapg.properties.enum_form_string_array: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["enum_form_string"]) -> MetaOapg.properties.enum_form_string: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + enum_form_string_array: typing.Union[MetaOapg.properties.enum_form_string_array, 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[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': + return super().__new__( + cls, + *args, + enum_form_string_array=enum_form_string_array, + enum_form_string=enum_form_string, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.py index 703bb7b249f..9acb054340c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -133,8 +134,8 @@ class BaseApi(api_client.Api): def _group_parameters( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -208,8 +209,8 @@ class GroupParameters(BaseApi): def group_parameters( self: BaseApi, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -230,8 +231,8 @@ class ApiFordelete(BaseApi): def delete( self: BaseApi, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.pyi new file mode 100644 index 00000000000..830368729dd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_3/delete.pyi @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params +RequiredStringGroupSchema = schemas.IntSchema +RequiredInt64GroupSchema = schemas.Int64Schema +StringGroupSchema = schemas.IntSchema +Int64GroupSchema = schemas.Int64Schema +# header params +RequiredBooleanGroupSchema = schemas.BoolSchema +BooleanGroupSchema = schemas.BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py index d38d852e079..21157e9f504 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi new file mode 100644 index 00000000000..791104618dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums +SchemaFor200ResponseBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py index 65bbd8e58cf..6657fb0af5c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi new file mode 100644 index 00000000000..bb1fc2d4ba5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py index 54d3da5a773..33ebe460ffd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User @@ -86,7 +87,7 @@ class BaseApi(api_client.Api): def _body_with_query_params( self: api_client.Api, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -161,7 +162,7 @@ class BodyWithQueryParams(BaseApi): def body_with_query_params( self: BaseApi, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -186,7 +187,7 @@ class ApiForput(BaseApi): def put( self: BaseApi, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = 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-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi new file mode 100644 index 00000000000..fcb679841ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# query params +QuerySchema = schemas.StrSchema +# body param +SchemaForRequestBodyApplicationJson = User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py index 4492123ed8a..501225c6206 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -89,7 +90,7 @@ class BaseApi(api_client.Api): def _case_sensitive_params( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -148,7 +149,7 @@ class CaseSensitiveParams(BaseApi): def case_sensitive_params( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -169,7 +170,7 @@ class ApiForput(BaseApi): def put( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi new file mode 100644 index 00000000000..450815ff1e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params +SomeVarSchema = schemas.StrSchema +SomeVarSchema = schemas.StrSchema +SomeVarSchema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py index 410c24b3cb4..1b98b3dd9bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.client import Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi new file mode 100644 index 00000000000..44716cf521f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client +SchemaFor200ResponseBodyApplicationJson = Client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py index ba8bc4b12a1..5a56c25ae64 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -83,7 +84,7 @@ class BaseApi(api_client.Api): def _delete_coffee( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -146,7 +147,7 @@ class DeleteCoffee(BaseApi): def delete_coffee( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -168,7 +169,7 @@ class ApiFordelete(BaseApi): def delete( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi new file mode 100644 index 00000000000..12a44d309d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# path params +IdSchema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py index ad73ddbfc45..f809cecd35c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.health_check_result import HealthCheckResult diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi new file mode 100644 index 00000000000..8c6bb376381 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.health_check_result import HealthCheckResult + +SchemaFor200ResponseBodyApplicationJson = HealthCheckResult diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py index c6f6b425779..277cc154e72 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -34,10 +35,14 @@ class SchemaForRequestBodyApplicationJson( class MetaOapg: additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, str, ], ) -> 'SchemaForRequestBodyApplicationJson': @@ -77,7 +82,7 @@ class BaseApi(api_client.Api): def _inline_additional_properties( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -138,7 +143,7 @@ class InlineAdditionalProperties(BaseApi): def inline_additional_properties( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, ], content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -161,7 +166,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, ], + body: typing.Union[SchemaForRequestBodyApplicationJson, 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-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi new file mode 100644 index 00000000000..0dfab37fdb2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) 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 435b1e0cd61..ab931776da6 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -59,12 +60,16 @@ class CompositionAtRootSchema( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'CompositionAtRootSchema': return super().__new__( cls, @@ -115,12 +120,16 @@ class CompositionInPropertySchema( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'someProp': return super().__new__( cls, @@ -128,16 +137,26 @@ class CompositionInPropertySchema( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "someProp": someProp, + } additional_properties = schemas.AnyTypeSchema someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'CompositionInPropertySchema': return super().__new__( cls, @@ -154,8 +173,8 @@ RequestRequiredQueryParams = typing.TypedDict( RequestOptionalQueryParams = typing.TypedDict( 'RequestOptionalQueryParams', { - 'compositionAtRoot': typing.Union[CompositionAtRootSchema, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], - 'compositionInProperty': typing.Union[CompositionInPropertySchema, dict, frozendict, ], + 'compositionAtRoot': typing.Union[CompositionAtRootSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + 'compositionInProperty': typing.Union[CompositionInPropertySchema, dict, frozendict.frozendict, ], }, total=False ) @@ -212,12 +231,16 @@ class SchemaForRequestBodyApplicationJson( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, @@ -268,12 +291,16 @@ class SchemaForRequestBodyMultipartFormData( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'someProp': return super().__new__( cls, @@ -281,16 +308,26 @@ class SchemaForRequestBodyMultipartFormData( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "someProp": someProp, + } additional_properties = schemas.AnyTypeSchema someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, @@ -343,12 +380,16 @@ class SchemaFor200ResponseBodyApplicationJson( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, @@ -399,12 +440,16 @@ class SchemaFor200ResponseBodyMultipartFormData( cls.all_of_0, ] + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'someProp': return super().__new__( cls, @@ -412,16 +457,26 @@ class SchemaFor200ResponseBodyMultipartFormData( _configuration=_configuration, **kwargs, ) + __annotations__ = { + "someProp": someProp, + } additional_properties = schemas.AnyTypeSchema someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], - someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + *args: typing.Union[dict, frozendict.frozendict, ], + someProp: typing.Union[MetaOapg.properties.someProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor200ResponseBodyMultipartFormData': return super().__new__( cls, @@ -464,8 +519,8 @@ class BaseApi(api_client.Api): def _inline_composition( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -543,8 +598,8 @@ class InlineComposition(BaseApi): def inline_composition( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -570,8 +625,8 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/fake_inline_composition_/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.pyi new file mode 100644 index 00000000000..7d01ee5536e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.pyi @@ -0,0 +1,426 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params + + +class CompositionAtRootSchema( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'CompositionAtRootSchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +class CompositionInPropertySchema( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + + + class someProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, 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, + } + additional_properties = schemas.AnyTypeSchema + + someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'CompositionInPropertySchema': + return super().__new__( + cls, + *args, + someProp=someProp, + _configuration=_configuration, + **kwargs, + ) +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +class SchemaForRequestBodyMultipartFormData( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + + + class someProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, 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, + } + additional_properties = schemas.AnyTypeSchema + + someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + someProp=someProp, + _configuration=_configuration, + **kwargs, + ) + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ComposedSchema, +): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +class SchemaFor200ResponseBodyMultipartFormData( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + + + class someProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + + class all_of_0( + schemas.StrSchema + ): + pass + + @classmethod + @property + @functools.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 __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, 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, + } + additional_properties = schemas.AnyTypeSchema + + someProp: MetaOapg.properties.someProp + + @typing.overload + def __getitem__(self, name: typing.Literal["someProp"]) -> MetaOapg.properties.someProp: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor200ResponseBodyMultipartFormData': + return super().__new__( + cls, + *args, + someProp=someProp, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py index b6637294011..a78729d21aa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -40,18 +41,32 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( class properties: param = schemas.StrSchema param2 = schemas.StrSchema + __annotations__ = { + "param": param, + "param2": param2, + } additional_properties = schemas.AnyTypeSchema param: MetaOapg.properties.param param2: MetaOapg.properties.param2 + + @typing.overload + def __getitem__(self, name: typing.Literal["param"]) -> MetaOapg.properties.param: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["param2"]) -> MetaOapg.properties.param2: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *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[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, @@ -90,7 +105,7 @@ class BaseApi(api_client.Api): def _json_form_data( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -149,7 +164,7 @@ class JsonFormData(BaseApi): def json_form_data( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -172,7 +187,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi new file mode 100644 index 00000000000..89af3526e21 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "param", + "param2", + } + class properties: + param = schemas.StrSchema + param2 = schemas.StrSchema + __annotations__ = { + "param": param, + "param2": param2, + } + additional_properties = schemas.AnyTypeSchema + + param: MetaOapg.properties.param + param2: MetaOapg.properties.param2 + + @typing.overload + def __getitem__(self, name: typing.Literal["param"]) -> MetaOapg.properties.param: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["param2"]) -> MetaOapg.properties.param2: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': + return super().__new__( + cls, + *args, + param=param, + param2=param2, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py index 2ca0a25a905..d55d3940397 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -65,7 +66,7 @@ class BaseApi(api_client.Api): def _json_with_charset( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, content_type: str = 'application/json; charset=utf-8', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -128,7 +129,7 @@ class JsonWithCharset(BaseApi): def json_with_charset( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, content_type: str = 'application/json; charset=utf-8', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -153,7 +154,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyApplicationJsonCharsetutf8, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, content_type: str = 'application/json; charset=utf-8', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi new file mode 100644 index 00000000000..c4e84cdca05 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema +SchemaFor200ResponseBodyApplicationJsonCharsetutf8 = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py index a6675aba96b..fed49dbebf0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -34,16 +35,26 @@ class MapBeanSchema( class MetaOapg: class properties: keyword = schemas.StrSchema + __annotations__ = { + "keyword": keyword, + } additional_properties = schemas.AnyTypeSchema keyword: MetaOapg.properties.keyword + + @typing.overload + def __getitem__(self, name: typing.Literal["keyword"]) -> MetaOapg.properties.keyword: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], keyword: typing.Union[MetaOapg.properties.keyword, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'MapBeanSchema': return super().__new__( cls, @@ -60,7 +71,7 @@ RequestRequiredQueryParams = typing.TypedDict( RequestOptionalQueryParams = typing.TypedDict( 'RequestOptionalQueryParams', { - 'mapBean': typing.Union[MapBeanSchema, dict, frozendict, ], + 'mapBean': typing.Union[MapBeanSchema, dict, frozendict.frozendict, ], }, total=False ) @@ -97,7 +108,7 @@ class BaseApi(api_client.Api): def _object_in_query( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -155,7 +166,7 @@ class ObjectInQuery(BaseApi): def object_in_query( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -176,7 +187,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi new file mode 100644 index 00000000000..d20934ea566 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params + + +class MapBeanSchema( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + keyword = schemas.StrSchema + __annotations__ = { + "keyword": keyword, + } + additional_properties = schemas.AnyTypeSchema + + keyword: MetaOapg.properties.keyword + + @typing.overload + def __getitem__(self, name: typing.Literal["keyword"]) -> MetaOapg.properties.keyword: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + keyword: typing.Union[MetaOapg.properties.keyword, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'MapBeanSchema': + return super().__new__( + cls, + *args, + keyword=keyword, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py index 4ff0cfc7ff5..aef0c788c24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -285,11 +286,11 @@ class BaseApi(api_client.Api): def _parameter_collisions( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), - cookie_params: RequestCookieParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + cookie_params: RequestCookieParams = frozendict.frozendict(), content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -401,11 +402,11 @@ class ParameterCollisions(BaseApi): def parameter_collisions( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), - cookie_params: RequestCookieParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + cookie_params: RequestCookieParams = frozendict.frozendict(), content_type: str = 'application/json', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -434,11 +435,11 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, - query_params: RequestQueryParams = frozendict(), - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), - cookie_params: RequestCookieParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationJson, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + cookie_params: RequestCookieParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi new file mode 100644 index 00000000000..7d63e5818fe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params +Model1Schema = schemas.StrSchema +ABSchema = schemas.StrSchema +AbSchema = schemas.StrSchema +ModelSelfSchema = schemas.StrSchema +ABSchema = schemas.StrSchema +# header params +Model1Schema = schemas.StrSchema +ABSchema = schemas.StrSchema +ModelSelfSchema = schemas.StrSchema +ABSchema = schemas.StrSchema +# path params +Model1Schema = schemas.StrSchema +ABSchema = schemas.StrSchema +AbSchema = schemas.StrSchema +ModelSelfSchema = schemas.StrSchema +ABSchema = schemas.StrSchema +# cookie params +Model1Schema = schemas.StrSchema +ABSchema = schemas.StrSchema +AbSchema = schemas.StrSchema +ModelSelfSchema = schemas.StrSchema +ABSchema = schemas.StrSchema +# body param +SchemaForRequestBodyApplicationJson = schemas.AnyTypeSchema +SchemaFor200ResponseBodyApplicationJson = schemas.AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py index c27d8fffc04..4921c11fb2d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.api_response import ApiResponse @@ -67,18 +68,32 @@ class SchemaForRequestBodyMultipartFormData( class properties: additionalMetadata = schemas.StrSchema requiredFile = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, + } additional_properties = schemas.AnyTypeSchema requiredFile: MetaOapg.properties.requiredFile additionalMetadata: MetaOapg.properties.additionalMetadata + + @typing.overload + def __getitem__(self, name: typing.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], requiredFile: typing.Union[MetaOapg.properties.requiredFile, ], additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, @@ -130,8 +145,8 @@ class BaseApi(api_client.Api): def _upload_file_with_required_file( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -209,8 +224,8 @@ class UploadFileWithRequiredFile(BaseApi): def upload_file_with_required_file( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -236,8 +251,8 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi new file mode 100644 index 00000000000..0318a223c6a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.api_response import ApiResponse + +# path params +PetIdSchema = schemas.Int64Schema +# body param + + +class SchemaForRequestBodyMultipartFormData( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "requiredFile", + } + class properties: + additionalMetadata = schemas.StrSchema + requiredFile = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, + } + additional_properties = schemas.AnyTypeSchema + + requiredFile: MetaOapg.properties.requiredFile + additionalMetadata: MetaOapg.properties.additionalMetadata + + @typing.overload + def __getitem__(self, name: typing.Literal["requiredFile"]) -> MetaOapg.properties.requiredFile: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + requiredFile: typing.Union[MetaOapg.properties.requiredFile, ], + additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + requiredFile=requiredFile, + additionalMetadata=additionalMetadata, + _configuration=_configuration, + **kwargs, + ) +SchemaFor200ResponseBodyApplicationJson = ApiResponse diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py index 13fbf356f1c..3cc55368738 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.foo import Foo @@ -72,7 +73,7 @@ class BaseApi(api_client.Api): def _ref_object_in_query( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -130,7 +131,7 @@ class RefObjectInQuery(BaseApi): def ref_object_in_query( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -151,7 +152,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi new file mode 100644 index 00000000000..fbcc88f14b3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.foo import Foo + +# query params +MapBeanSchema = Foo diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py index 41239f3f274..a31312b123e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi new file mode 100644 index 00000000000..91bc430ddf7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ArrayOfEnums +SchemaFor200ResponseBodyApplicationJson = ArrayOfEnums diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py index 542825b2321..2c939c4b36f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi new file mode 100644 index 00000000000..376a0c9c8fe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = AnimalFarm +SchemaFor200ResponseBodyApplicationJson = AnimalFarm diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py index 79de5ad07b7..3239cfcf28c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi new file mode 100644 index 00000000000..7c79c925107 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.BoolSchema +SchemaFor200ResponseBodyApplicationJson = schemas.BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py index e32934e6653..3e9305c2960 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi new file mode 100644 index 00000000000..e235e9ad86e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ComposedOneOfDifferentTypes +SchemaFor200ResponseBodyApplicationJson = ComposedOneOfDifferentTypes diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py index b03c147c758..acfc126649d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi new file mode 100644 index 00000000000..c4b60ce492a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = StringEnum +SchemaFor200ResponseBodyApplicationJson = StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py index 175a8adeeb1..31103e44998 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.mammal import Mammal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi new file mode 100644 index 00000000000..596cf70a93e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.mammal import Mammal + +# body param +SchemaForRequestBodyApplicationJson = Mammal +SchemaFor200ResponseBodyApplicationJson = Mammal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py index 35582ac9387..c7710b60e46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi new file mode 100644 index 00000000000..75eaf2e4b37 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = NumberWithValidations +SchemaFor200ResponseBodyApplicationJson = NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py index 4f6c3d4d103..f0360216e9d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi new file mode 100644 index 00000000000..40d31f99630 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # 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 + +# body param +SchemaForRequestBodyApplicationJson = ObjectModelWithRefProps +SchemaFor200ResponseBodyApplicationJson = ObjectModelWithRefProps diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py index 09f7063e6df..e0c55f2e914 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi new file mode 100644 index 00000000000..7428f253fc5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationJson = schemas.StrSchema +SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py index 96964ab0aa4..e87936003cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi new file mode 100644 index 00000000000..b21cf6f6a25 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py index f8b464e7c63..36a4f4f5c9e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.string_with_validation import StringWithValidation @@ -47,7 +48,7 @@ class PipeSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -70,7 +71,7 @@ class IoutilSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -93,7 +94,7 @@ class HttpSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -116,7 +117,7 @@ class UrlSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) @@ -139,7 +140,7 @@ class ContextSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) RefParamSchema = StringWithValidation RequestRequiredQueryParams = typing.TypedDict( @@ -225,7 +226,7 @@ class BaseApi(api_client.Api): def _query_parameter_collection_format( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -287,7 +288,7 @@ class QueryParameterCollectionFormat(BaseApi): def query_parameter_collection_format( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -308,7 +309,7 @@ class ApiForput(BaseApi): def put( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi new file mode 100644 index 00000000000..024902f4787 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.string_with_validation import StringWithValidation + +# query params + + +class PipeSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'PipeSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class IoutilSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'IoutilSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class HttpSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'HttpSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class UrlSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'UrlSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class ContextSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'ContextSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) +RefParamSchema = StringWithValidation diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py index 9d85ddda9da..622475888fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi new file mode 100644 index 00000000000..2007a569ead --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# body param +SchemaForRequestBodyApplicationOctetStream = schemas.BinarySchema +SchemaFor200ResponseBodyApplicationOctetStream = schemas.BinarySchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py index ee1e300e3d5..a6b695e06ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.api_response import ApiResponse @@ -41,18 +42,32 @@ class SchemaForRequestBodyMultipartFormData( class properties: additionalMetadata = schemas.StrSchema file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } additional_properties = schemas.AnyTypeSchema file: MetaOapg.properties.file additionalMetadata: MetaOapg.properties.additionalMetadata + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> MetaOapg.properties.file: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], file: typing.Union[MetaOapg.properties.file, ], additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, @@ -101,7 +116,7 @@ class BaseApi(api_client.Api): def _upload_file( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -164,7 +179,7 @@ class UploadFile(BaseApi): def upload_file( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -189,7 +204,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi new file mode 100644 index 00000000000..3c95d8e4fda --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.api_response import ApiResponse + +# body param + + +class SchemaForRequestBodyMultipartFormData( + schemas.DictSchema +): + + + class MetaOapg: + required = { + "file", + } + class properties: + additionalMetadata = schemas.StrSchema + file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } + additional_properties = schemas.AnyTypeSchema + + file: MetaOapg.properties.file + additionalMetadata: MetaOapg.properties.additionalMetadata + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> MetaOapg.properties.file: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + file: typing.Union[MetaOapg.properties.file, ], + additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + file=file, + additionalMetadata=additionalMetadata, + _configuration=_configuration, + **kwargs, + ) +SchemaFor200ResponseBodyApplicationJson = ApiResponse diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py index 3b759527410..279f2bc6237 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.api_response import ApiResponse @@ -57,18 +58,28 @@ class SchemaForRequestBodyMultipartFormData( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) + __annotations__ = { + "files": files, + } additional_properties = schemas.AnyTypeSchema files: MetaOapg.properties.files + + @typing.overload + def __getitem__(self, name: typing.Literal["files"]) -> MetaOapg.properties.files: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], files: typing.Union[MetaOapg.properties.files, tuple, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, @@ -116,7 +127,7 @@ class BaseApi(api_client.Api): def _upload_files( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -179,7 +190,7 @@ class UploadFiles(BaseApi): def upload_files( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -204,7 +215,7 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi new file mode 100644 index 00000000000..4ec62646b39 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.api_response import ApiResponse + +# body param + + +class SchemaForRequestBodyMultipartFormData( + 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, ]], typing.List[typing.Union[MetaOapg.items, ]]], + _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, + } + additional_properties = schemas.AnyTypeSchema + + files: MetaOapg.properties.files + + @typing.overload + def __getitem__(self, name: typing.Literal["files"]) -> MetaOapg.properties.files: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + files: typing.Union[MetaOapg.properties.files, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + files=files, + _configuration=_configuration, + **kwargs, + ) +SchemaFor200ResponseBodyApplicationJson = ApiResponse diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py index df495f3c315..2da6dcefb36 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.foo import Foo @@ -40,16 +41,26 @@ class SchemaFor0ResponseBodyApplicationJson( @property def string(cls) -> typing.Type['Foo']: return Foo + __annotations__ = { + "string": string, + } additional_properties = schemas.AnyTypeSchema string: 'Foo' + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> 'Foo': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], string: typing.Union['Foo', schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaFor0ResponseBodyApplicationJson': return super().__new__( cls, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi new file mode 100644 index 00000000000..279c5d8f3d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.foo import Foo + + + +class SchemaFor0ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + + @classmethod + @property + def string(cls) -> typing.Type['Foo']: + return Foo + __annotations__ = { + "string": string, + } + additional_properties = schemas.AnyTypeSchema + + string: 'Foo' + + @typing.overload + def __getitem__(self, name: typing.Literal["string"]) -> 'Foo': ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + string: typing.Union['Foo', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaFor0ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + string=string, + _configuration=_configuration, + **kwargs, + ) 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 03c37d1e048..7787fe26e38 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.pet import Pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi new file mode 100644 index 00000000000..d9f68525db5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + +# body param +SchemaForRequestBodyApplicationJson = Pet +SchemaForRequestBodyApplicationXml = Pet 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 610a5ecf73b..3813923ec2e 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 @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.pet import Pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.pyi new file mode 100644 index 00000000000..d9f68525db5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_2/put.pyi @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + +# body param +SchemaForRequestBodyApplicationJson = Pet +SchemaForRequestBodyApplicationXml = Pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py index ffa5af4ee4a..7005670bc46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.pet import Pet @@ -74,7 +75,7 @@ class StatusSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) RequestRequiredQueryParams = typing.TypedDict( 'RequestRequiredQueryParams', @@ -129,7 +130,7 @@ class SchemaFor200ResponseBodyApplicationXml( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Pet': return super().__getitem__(i) @@ -156,7 +157,7 @@ class SchemaFor200ResponseBodyApplicationJson( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Pet': return super().__getitem__(i) @@ -205,7 +206,7 @@ class BaseApi(api_client.Api): def _find_pets_by_status( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -271,7 +272,7 @@ class FindPetsByStatus(BaseApi): def find_pets_by_status( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -294,7 +295,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/pet_find_by_status/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.pyi new file mode 100644 index 00000000000..551e4437cf7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.pyi @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + +# query params + + +class StatusSchema( + schemas.ListSchema +): + + + class MetaOapg: + + + class items( + schemas.SchemaEnumMakerClsFactory( + enum_value_to_name={ + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + ), + schemas.StrSchema + ): + + @classmethod + @property + def AVAILABLE(cls): + return cls("available") + + @classmethod + @property + def PENDING(cls): + return cls("pending") + + @classmethod + @property + def SOLD(cls): + return cls("sold") + + 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, + ) -> 'StatusSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class SchemaFor200ResponseBodyApplicationXml( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Pet']: + return Pet + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationXml': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Pet': + return super().__getitem__(i) + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Pet']: + return Pet + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Pet': + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py index cc370df8749..8839ddc574d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.pet import Pet @@ -48,7 +49,7 @@ class TagsSchema( _configuration=_configuration, ) - def __getitem__(self, i) -> MetaOapg.items: + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) RequestRequiredQueryParams = typing.TypedDict( 'RequestRequiredQueryParams', @@ -103,7 +104,7 @@ class SchemaFor200ResponseBodyApplicationXml( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Pet': return super().__getitem__(i) @@ -130,7 +131,7 @@ class SchemaFor200ResponseBodyApplicationJson( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'Pet': return super().__getitem__(i) @@ -179,7 +180,7 @@ class BaseApi(api_client.Api): def _find_pets_by_tags( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -245,7 +246,7 @@ class FindPetsByTags(BaseApi): def find_pets_by_tags( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -268,7 +269,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/pet_find_by_tags/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.pyi new file mode 100644 index 00000000000..05a170bd935 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.pyi @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + +# query params + + +class TagsSchema( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + 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, + ) -> 'TagsSchema': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +class SchemaFor200ResponseBodyApplicationXml( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Pet']: + return Pet + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationXml': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Pet': + return super().__getitem__(i) + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['Pet']: + return Pet + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Pet'], typing.List['Pet']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'Pet': + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py index 7bfe3ce8a39..ffd8db8b4f0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -99,8 +100,8 @@ class BaseApi(api_client.Api): def _delete_pet( self: api_client.Api, - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -170,8 +171,8 @@ class DeletePet(BaseApi): def delete_pet( self: BaseApi, - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -192,8 +193,8 @@ class ApiFordelete(BaseApi): def delete( self: BaseApi, - header_params: RequestHeaderParams = frozendict(), - path_params: RequestPathParams = frozendict(), + header_params: RequestHeaderParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi new file mode 100644 index 00000000000..ccf61263f02 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# header params +ApiKeySchema = schemas.StrSchema +# path params +PetIdSchema = schemas.Int64Schema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.py index 7d085f8a84a..0edb2616e2a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.pet import Pet @@ -117,7 +118,7 @@ class BaseApi(api_client.Api): def _get_pet_by_id( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -183,7 +184,7 @@ class GetPetById(BaseApi): def get_pet_by_id( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -206,7 +207,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/pet_pet_id_1/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.pyi new file mode 100644 index 00000000000..448e21b9020 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_1/get.pyi @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.pet import Pet + +# path params +PetIdSchema = schemas.Int64Schema +SchemaFor200ResponseBodyApplicationXml = Pet +SchemaFor200ResponseBodyApplicationJson = Pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.py index 4aadba7ffcc..794704c704c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -62,18 +63,32 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( class properties: name = schemas.StrSchema status = schemas.StrSchema + __annotations__ = { + "name": name, + "status": status, + } additional_properties = schemas.AnyTypeSchema name: MetaOapg.properties.name status: MetaOapg.properties.status + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *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[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, @@ -115,8 +130,8 @@ class BaseApi(api_client.Api): def _update_pet_with_form( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -189,8 +204,8 @@ class UpdatePetWithForm(BaseApi): def update_pet_with_form( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -213,8 +228,8 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'application/x-www-form-urlencoded', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.pyi new file mode 100644 index 00000000000..5407624ea1e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_3/post.pyi @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# path params +PetIdSchema = schemas.Int64Schema +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + name = schemas.StrSchema + status = schemas.StrSchema + __annotations__ = { + "name": name, + "status": status, + } + additional_properties = schemas.AnyTypeSchema + + name: MetaOapg.properties.name + status: MetaOapg.properties.status + + @typing.overload + def __getitem__(self, name: typing.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["status"]) -> MetaOapg.properties.status: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': + return super().__new__( + cls, + *args, + name=name, + status=status, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py index 37f5b75d07f..b595015b96f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.api_response import ApiResponse @@ -64,18 +65,32 @@ class SchemaForRequestBodyMultipartFormData( class properties: additionalMetadata = schemas.StrSchema file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } additional_properties = schemas.AnyTypeSchema additionalMetadata: MetaOapg.properties.additionalMetadata file: MetaOapg.properties.file + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> MetaOapg.properties.file: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], additionalMetadata: typing.Union[MetaOapg.properties.additionalMetadata, str, schemas.Unset] = schemas.unset, file: typing.Union[MetaOapg.properties.file, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, @@ -127,8 +142,8 @@ class BaseApi(api_client.Api): def _upload_image( self: api_client.Api, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -206,8 +221,8 @@ class UploadImage(BaseApi): def upload_image( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -233,8 +248,8 @@ class ApiForpost(BaseApi): def post( self: BaseApi, - body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict, schemas.Unset] = schemas.unset, - path_params: RequestPathParams = frozendict(), + body: typing.Union[SchemaForRequestBodyMultipartFormData, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'multipart/form-data', accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi new file mode 100644 index 00000000000..377a0ffbcc0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.api_response import ApiResponse + +# path params +PetIdSchema = schemas.Int64Schema +# body param + + +class SchemaForRequestBodyMultipartFormData( + schemas.DictSchema +): + + + class MetaOapg: + class properties: + additionalMetadata = schemas.StrSchema + file = schemas.BinarySchema + __annotations__ = { + "additionalMetadata": additionalMetadata, + "file": file, + } + additional_properties = schemas.AnyTypeSchema + + additionalMetadata: MetaOapg.properties.additionalMetadata + file: MetaOapg.properties.file + + @typing.overload + def __getitem__(self, name: typing.Literal["additionalMetadata"]) -> MetaOapg.properties.additionalMetadata: ... + + @typing.overload + def __getitem__(self, name: typing.Literal["file"]) -> MetaOapg.properties.file: ... + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(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, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ], + ) -> 'SchemaForRequestBodyMultipartFormData': + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + file=file, + _configuration=_configuration, + **kwargs, + ) +SchemaFor200ResponseBodyApplicationJson = ApiResponse diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py index a86a07f957e..490914c5c3e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -36,10 +37,14 @@ class SchemaFor200ResponseBodyApplicationJson( class MetaOapg: additional_properties = schemas.Int32Schema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) def __new__( cls, - *args: typing.Union[dict, frozendict, ], + *args: typing.Union[dict, frozendict.frozendict, ], _configuration: typing.Optional[schemas.Configuration] = None, **kwargs: typing.Union[MetaOapg.additional_properties, int, ], ) -> 'SchemaFor200ResponseBodyApplicationJson': diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi new file mode 100644 index 00000000000..391aead3dc0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.Int32Schema + + def __getitem__(self, name: str) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, int, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py index 178890409df..e483547fb4b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.order import Order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi new file mode 100644 index 00000000000..a4040805bfe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.order import Order + +# body param +SchemaForRequestBodyApplicationJson = Order +SchemaFor200ResponseBodyApplicationXml = Order +SchemaFor200ResponseBodyApplicationJson = Order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py index 2b067b24194..06ad6b3417d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -83,7 +84,7 @@ class BaseApi(api_client.Api): def _delete_order( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -140,7 +141,7 @@ class DeleteOrder(BaseApi): def delete_order( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -160,7 +161,7 @@ class ApiFordelete(BaseApi): def delete( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi new file mode 100644 index 00000000000..4fa09c82002 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# path params +OrderIdSchema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.py index 35153f03cf6..3244f4b29c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.order import Order @@ -123,7 +124,7 @@ class BaseApi(api_client.Api): def _get_order_by_id( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -188,7 +189,7 @@ class GetOrderById(BaseApi): def get_order_by_id( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -211,7 +212,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/store_order_order_id_1/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.pyi new file mode 100644 index 00000000000..716e543e6ec --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id_1/get.pyi @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.order import Order + +# path params + + +class OrderIdSchema( + schemas.Int64Schema +): + pass +SchemaFor200ResponseBodyApplicationXml = Order +SchemaFor200ResponseBodyApplicationJson = Order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py index 1f03761cf52..5b8d6d7c5c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi new file mode 100644 index 00000000000..620b310ff40 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# body param +SchemaForRequestBodyApplicationJson = User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py index 15034c003e0..dd4b2e2917b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User @@ -52,7 +53,7 @@ class SchemaForRequestBodyApplicationJson( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'User': return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi new file mode 100644 index 00000000000..f162679de47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['User']: + return User + + def __new__( + cls, + arg: typing.Union[typing.Tuple['User'], typing.List['User']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'User': + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py index 3ef1c9a134c..99c6ba5ab6f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User @@ -52,7 +53,7 @@ class SchemaForRequestBodyApplicationJson( _configuration=_configuration, ) - def __getitem__(self, i) -> 'items': + def __getitem__(self, i: int) -> 'User': return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi new file mode 100644 index 00000000000..f162679de47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @classmethod + @property + def items(cls) -> typing.Type['User']: + return User + + def __new__( + cls, + arg: typing.Union[typing.Tuple['User'], typing.List['User']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'User': + return super().__getitem__(i) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py index 04094366afa..1512661d27e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -132,7 +133,7 @@ class BaseApi(api_client.Api): def _login_user( self: api_client.Api, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -198,7 +199,7 @@ class LoginUser(BaseApi): def login_user( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -221,7 +222,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - query_params: RequestQueryParams = frozendict(), + query_params: RequestQueryParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/user_login/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.pyi new file mode 100644 index 00000000000..1acd6d5ea07 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.pyi @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# query params +UsernameSchema = schemas.StrSchema +PasswordSchema = schemas.StrSchema +XRateLimitSchema = schemas.Int32Schema +XExpiresAfterSchema = schemas.DateTimeSchema +SchemaFor200ResponseBodyApplicationXml = schemas.StrSchema +SchemaFor200ResponseBodyApplicationJson = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py index e2c5f113e02..ae45c816037 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi new file mode 100644 index 00000000000..1113bd65b79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py index 5b79b0b9fc0..5535f6d339d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py @@ -16,9 +16,10 @@ import functools # noqa: F401 from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from . import path @@ -83,7 +84,7 @@ class BaseApi(api_client.Api): def _delete_user( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -140,7 +141,7 @@ class DeleteUser(BaseApi): def delete_user( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -160,7 +161,7 @@ class ApiFordelete(BaseApi): def delete( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi new file mode 100644 index 00000000000..3cbcc1aa559 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +# path params +UsernameSchema = schemas.StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.py index 1ebc0154043..6cb3472320b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User @@ -114,7 +115,7 @@ class BaseApi(api_client.Api): def _get_user_by_name( self: api_client.Api, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,7 +180,7 @@ class GetUserByName(BaseApi): def get_user_by_name( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -202,7 +203,7 @@ class ApiForget(BaseApi): def get( self: BaseApi, - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), 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-experimental/petstore_api/paths/user_username_1/get.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.pyi new file mode 100644 index 00000000000..243421fc059 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_1/get.pyi @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# path params +UsernameSchema = schemas.StrSchema +SchemaFor200ResponseBodyApplicationXml = User +SchemaFor200ResponseBodyApplicationJson = User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.py index 7f670221558..c1d3e499dce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.py @@ -17,9 +17,10 @@ from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 -from frozendict import frozendict # noqa: F401 import uuid # noqa: F401 +import frozendict # noqa: F401 + from petstore_api import schemas # noqa: F401 from petstore_api.model.user import User @@ -98,7 +99,7 @@ class BaseApi(api_client.Api): def _update_user( self: api_client.Api, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -173,7 +174,7 @@ class UpdateUser(BaseApi): def update_user( self: BaseApi, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), content_type: str = 'application/json', stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,7 +198,7 @@ class ApiForput(BaseApi): def put( self: BaseApi, body: typing.Union[SchemaForRequestBodyApplicationJson, ], - path_params: RequestPathParams = frozendict(), + path_params: RequestPathParams = 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-experimental/petstore_api/paths/user_username_2/put.pyi b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.pyi new file mode 100644 index 00000000000..5803b64a661 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username_2/put.pyi @@ -0,0 +1,31 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +import functools # noqa: F401 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + +from petstore_api.model.user import User + +# path params +UsernameSchema = schemas.StrSchema +# body param +SchemaForRequestBodyApplicationJson = User 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 20b8badb0b5..3f4f770f61f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -19,7 +19,7 @@ import typing import uuid from dateutil.parser.isoparser import isoparser, _takes_ascii -from frozendict import frozendict +import frozendict from petstore_api.exceptions import ( ApiTypeError, @@ -79,7 +79,7 @@ def update(d: dict, u: dict): d[k] = d[k] | v -class ValidationMetadata(frozendict): +class ValidationMetadata(frozendict.frozendict): """ A class storing metadata that is needed to validate OpenApi Schema payloads """ @@ -89,7 +89,7 @@ class ValidationMetadata(frozendict): from_server: bool = False, configuration: typing.Optional[Configuration] = None, seen_classes: typing.FrozenSet[typing.Type] = frozenset(), - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict() + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() ): """ Args: @@ -244,7 +244,7 @@ class Schema: """ the base class of all swagger/openapi schemas/models """ - __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict, FileIO, bytes, BoolClass, NoneClass} + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} MetaOapg = MetaOapgTyped @classmethod @@ -252,7 +252,7 @@ class Schema: cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ Schema _validate Runs all schema validation logic and @@ -263,7 +263,7 @@ class Schema: - the returned instance is a serializable type (except for None, True, and False) which are enums Use cases: - 1. inheritable type: string/decimal.Decimal/frozendict/tuple + 1. inheritable type: string/decimal.Decimal/frozendict.frozendict/tuple 2. singletons: bool/None -> uses the base classes BoolClass/NoneClass Required Steps: @@ -286,7 +286,7 @@ class Schema: @staticmethod def __process_schema_classes( - schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]] + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] ): """ Processes and mutates schema_classes @@ -339,11 +339,11 @@ class Schema: for path, schema_classes in _path_to_schemas.items(): """ Use cases - 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict/str/Decimal/bytes/FileIo + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo needs Singleton added 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass Singleton already added - 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict/str/Decimal/bytes/FileIo + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo """ cls.__process_schema_classes(schema_classes) enum_schema = any( @@ -368,7 +368,7 @@ class Schema: path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] ): # We have a Dynamic class and we are making an instance of it - if issubclass(cls, frozendict): + if issubclass(cls, frozendict.frozendict): properties = cls._get_properties(arg, path_to_item, path_to_schemas) return super(Schema, cls).__new__(cls, properties) elif issubclass(cls, tuple): @@ -396,7 +396,7 @@ class Schema: None, 'Schema', dict, - frozendict, + frozendict.frozendict, tuple, list, io.FileIO, @@ -423,25 +423,25 @@ class Schema: return new_inst @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict: + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: input_dict = {} - if args and isinstance(args[0], (dict, frozendict)): + if args and isinstance(args[0], (dict, frozendict.frozendict)): input_dict.update(args[0]) if kwargs: input_dict.update(kwargs) - return frozendict(input_dict) + return frozendict.frozendict(input_dict) @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: - args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values _configuration: contains the Configuration that enables json schema validation keywords like minItems, minLength etc """ @@ -471,10 +471,10 @@ class Schema: def __init__( self, *args: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[ - dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] ): """ @@ -538,7 +538,7 @@ class Validator(typing.Protocol): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: pass @@ -610,7 +610,7 @@ def SchemaTypeCheckerClsFactory(union_type_cls: typing.Union[typing.Any]) -> Val cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaTypeChecker _validate Validates arg's type @@ -661,7 +661,7 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ SchemaEnumMaker _validate Validates that arg is in the enum's allowed values @@ -784,7 +784,7 @@ class StrBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ StrBase _validate Validates that validations pass @@ -1068,7 +1068,7 @@ class NumberBase(ValidatorBase): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ NumberBase _validate Validates that validations pass @@ -1301,10 +1301,12 @@ class DictBase(Discriminable, ValidatorBase): invalid_arguments = [] required_property_names = getattr(cls.MetaOapg, 'required', set()) additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name in arg: if property_name in required_property_names: seen_required_properties.add(property_name) - elif property_name in cls._property_names: + elif property_name in property_annotations: continue elif additional_properties: continue @@ -1348,15 +1350,20 @@ class DictBase(Discriminable, ValidatorBase): """ path_to_schemas = {} additional_properties = getattr(cls.MetaOapg, 'additional_properties', AnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) for property_name, value in arg.items(): - if property_name in cls._property_names: - schema = getattr(cls.MetaOapg.properties, property_name) + if property_name in property_annotations: + schema = property_annotations[property_name] elif additional_properties: schema = additional_properties else: raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( value, cls, validation_metadata.path_to_item+(property_name,) )) + if isinstance(schema, classmethod): + # referenced schema, call classmethod property + schema = schema.__func__.fget(properties) arg_validation_metadata = ValidationMetadata( from_server=validation_metadata.from_server, configuration=validation_metadata.configuration, @@ -1418,10 +1425,10 @@ class DictBase(Discriminable, ValidatorBase): ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes ApiTypeError: when the input type is not in the list of allowed spec types """ - if isinstance(arg, frozendict): + if isinstance(arg, frozendict.frozendict): cls.__check_dict_validations(arg, validation_metadata) _path_to_schemas = super()._validate(arg, validation_metadata=validation_metadata) - if not isinstance(arg, frozendict): + if not isinstance(arg, frozendict.frozendict): return _path_to_schemas cls._validate_arg_presence(arg) other_path_to_schemas = cls._validate_args(arg, validation_metadata=validation_metadata) @@ -1457,30 +1464,6 @@ class DictBase(Discriminable, ValidatorBase): update(_path_to_schemas, other_path_to_schemas) return _path_to_schemas - @classmethod - @property - @functools.cache - def _property_names(cls) -> typing.Tuple[str]: - if not hasattr(cls.MetaOapg, 'properties'): - return tuple() - property_names = set() - for var_name, var_value in cls.MetaOapg.properties.__dict__.items(): - var_name: str - # referenced models are classmethods - is_classmethod = type(var_value) is classmethod - if is_classmethod: - property_names.add(var_name) - continue - is_class = type(var_value) is type - if not is_class: - continue - if not issubclass(var_value, Schema): - continue - property_names.add(var_name) - property_names = list(property_names) - property_names.sort() - return tuple(property_names) - @classmethod def _get_properties( cls, @@ -1525,7 +1508,7 @@ class DictBase(Discriminable, ValidatorBase): def __getattr__(self, name: str): # for instance.name access - if isinstance(self, frozendict): + if isinstance(self, frozendict.frozendict): # if an attribute does not exist try: return self[name] @@ -1535,11 +1518,11 @@ class DictBase(Discriminable, ValidatorBase): def cast_to_allowed_types( - arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema], + arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema], from_server: bool, - validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]], + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), -) -> typing.Union[frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: +) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: """ Casts the input payload arg into the allowed types The input validated_path_to_schemas is mutated by running this function @@ -1571,8 +1554,8 @@ def cast_to_allowed_types( if isinstance(arg, str): return str(arg) - elif isinstance(arg, (dict, frozendict)): - return frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) + elif isinstance(arg, (dict, frozendict.frozendict)): + return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) elif isinstance(arg, (bool, BoolClass)): """ this check must come before isinstance(arg, (int, float)) @@ -1694,7 +1677,7 @@ class ComposedBase(Discriminable): cls, arg, validation_metadata: ValidationMetadata, - ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict, tuple]]]: + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: """ ComposedBase _validate We return dynamic classes of different bases depending upon the inputs @@ -1724,7 +1707,7 @@ class ComposedBase(Discriminable): # process composed schema discriminator = getattr(cls, 'discriminator', None) discriminated_cls = None - if discriminator and arg and isinstance(arg, frozendict): + if discriminator and arg and isinstance(arg, frozendict.frozendict): disc_property_name = list(discriminator.keys())[0] cls._ensure_discriminator_value_present(disc_property_name, updated_vm, arg) # get discriminated_cls by looking at the dict in the current class @@ -1788,7 +1771,7 @@ class ComposedBase(Discriminable): # DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase class ComposedSchema( - SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[NoneClass, str, decimal.Decimal, BoolClass, tuple, frozendict.frozendict]), ComposedBase, DictBase, ListBase, @@ -2093,7 +2076,7 @@ class BoolSchema( class AnyTypeSchema( SchemaTypeCheckerClsFactory( - typing.Union[frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] + typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, BoolClass, NoneClass, bytes, FileIO] ), DictBase, ListBase, @@ -2107,7 +2090,7 @@ class AnyTypeSchema( class DictSchema( - SchemaTypeCheckerClsFactory(typing.Union[frozendict]), + SchemaTypeCheckerClsFactory(typing.Union[frozendict.frozendict]), DictBase, Schema, FrozenDictMixin @@ -2116,11 +2099,11 @@ class DictSchema( def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): return super()._from_openapi_data(arg, _configuration=_configuration) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): return super().__new__(cls, *args, **kwargs) -schema_type_classes = set([NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema]) +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema} @functools.cache diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py index fb6cad47bc7..57dece3c8be 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py @@ -12,11 +12,13 @@ import unittest +import frozendict + import petstore_api from petstore_api.model.cat import Cat from petstore_api.model.dog import Dog from petstore_api.model.animal import Animal -from petstore_api.schemas import StrSchema, BoolSchema, frozendict +from petstore_api.schemas import StrSchema, BoolSchema class TestAnimal(unittest.TestCase): @@ -40,7 +42,7 @@ class TestAnimal(unittest.TestCase): animal = Animal(className='Cat', color='black') assert isinstance(animal, Animal) - assert isinstance(animal, frozendict) + assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Cat) assert isinstance(animal, Cat.MetaOapg.all_of[1]) assert set(animal.keys()) == {'className', 'color'} @@ -52,7 +54,7 @@ class TestAnimal(unittest.TestCase): # pass in optional param animal = Animal(className='Cat', color='black', declawed=True) assert isinstance(animal, Animal) - assert isinstance(animal, frozendict) + assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, Cat) assert isinstance(animal, Cat.MetaOapg.all_of[1]) assert set(animal.keys()) == {'className', 'color', 'declawed'} @@ -65,7 +67,7 @@ class TestAnimal(unittest.TestCase): # make a Dog animal = Animal(className='Dog', color='black') - assert isinstance(animal, (Animal, frozendict, Dog, Dog.MetaOapg.all_of[1])) + assert isinstance(animal, (Animal, frozendict.frozendict, Dog, Dog.MetaOapg.all_of[1])) assert set(animal.keys()) == {'className', 'color'} assert animal.className == 'Dog' assert animal.color == 'black' @@ -74,7 +76,7 @@ class TestAnimal(unittest.TestCase): # pass in optional param animal = Animal(className='Dog', color='black', breed='Labrador') - assert isinstance(animal, (Animal, frozendict, Dog, Dog.MetaOapg.all_of[1])) + assert isinstance(animal, (Animal, frozendict.frozendict, Dog, Dog.MetaOapg.all_of[1])) assert set(animal.keys()) == {'className', 'color', 'breed'} assert animal.className == 'Dog' assert animal.color == 'black' diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py index 7f615ffdc49..98412e10035 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py @@ -13,6 +13,8 @@ import unittest from decimal import Decimal +import frozendict + import petstore_api from petstore_api.schemas import ( AnyTypeSchema, @@ -27,7 +29,6 @@ from petstore_api.schemas import ( DateTimeSchema, DecimalSchema, ComposedSchema, - frozendict, NoneClass, BoolClass ) @@ -47,8 +48,8 @@ class TestAnyTypeSchema(unittest.TestCase): assert isinstance(m, Model) assert isinstance(m, AnyTypeSchema) assert isinstance(m, DictSchema) - assert isinstance(m, frozendict) - assert m == frozendict(a=Decimal(1), b='hi') + assert isinstance(m, frozendict.frozendict) + assert m == frozendict.frozendict(a=Decimal(1), b='hi') def testListSchema(self): class Model(ComposedSchema): diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py index f08dd500b1d..a33cfc39a57 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py @@ -10,13 +10,13 @@ """ -import sys import unittest from datetime import date, datetime, timezone from dateutil.tz import tzutc -import petstore_api -from petstore_api.schemas import DateSchema, DateTimeSchema, Singleton, NoneClass, frozendict +import frozendict + +from petstore_api.schemas import DateSchema, DateTimeSchema, Singleton, NoneClass from petstore_api.model.animal import Animal from petstore_api.model.cat import Cat from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes @@ -42,13 +42,13 @@ class TestComposedOneOfDifferentTypes(unittest.TestCase): assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, Animal) assert isinstance(inst, Cat) - assert isinstance(inst, frozendict) + assert isinstance(inst, frozendict.frozendict) # object that holds 4 properties and is not an Animal inst = ComposedOneOfDifferentTypes(a="a", b="b", c="c", d="d") assert isinstance(inst, ComposedOneOfDifferentTypes) assert not isinstance(inst, Animal) - assert isinstance(inst, frozendict) + assert isinstance(inst, frozendict.frozendict) # None inst = ComposedOneOfDifferentTypes(None) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py index 91578395317..7fb01c05878 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py @@ -14,9 +14,11 @@ from decimal import Decimal import datetime import unittest +import frozendict + import petstore_api from petstore_api.model.format_test import FormatTest -from petstore_api.schemas import BinarySchema, BytesSchema, frozendict, Singleton +from petstore_api.schemas import BinarySchema, BytesSchema, Singleton class TestFormatTest(unittest.TestCase): @@ -108,7 +110,7 @@ class TestFormatTest(unittest.TestCase): assert isinstance(model.binary, BinarySchema) assert isinstance(model.binary, BytesSchema) assert isinstance(model.binary, bytes) - assert model == frozendict( + assert model == frozendict.frozendict( binary=b'123', number=Decimal(32.5), byte='a', diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py index c92f7805fb3..91c35a1cad5 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py @@ -10,14 +10,13 @@ """ -import sys import unittest -import petstore_api +import frozendict + from petstore_api.model import apple from petstore_api.model import banana from petstore_api.model.gm_fruit import GmFruit -from petstore_api.schemas import frozendict class TestGmFruit(unittest.TestCase): """GmFruit unit test stubs""" @@ -39,7 +38,7 @@ class TestGmFruit(unittest.TestCase): fruit = GmFruit(lengthCm=length_cm, color=color, cultivar=cultivar) assert isinstance(fruit, banana.Banana) assert isinstance(fruit, apple.Apple) - assert isinstance(fruit, frozendict) + assert isinstance(fruit, frozendict.frozendict) assert isinstance(fruit, GmFruit) # check its properties self.assertEqual(fruit.lengthCm, length_cm) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py index 60cd2e49574..f6e885111ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py @@ -9,12 +9,11 @@ Generated by: https://openapi-generator.tech """ -from datetime import date, datetime -import sys import unittest -import petstore_api -from petstore_api.schemas import BoolClass, frozendict +import frozendict + +from petstore_api.schemas import BoolClass from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from petstore_api.model.number_with_validations import NumberWithValidations @@ -34,7 +33,7 @@ class TestObjectModelWithRefProps(unittest.TestCase): inst = ObjectModelWithRefProps(myNumber=15.0, myString="a", myBoolean=True) assert isinstance(inst, ObjectModelWithRefProps) - assert isinstance(inst, frozendict) + assert isinstance(inst, frozendict.frozendict) assert set(inst.keys()) == {"myNumber", "myString", "myBoolean"} assert inst.myNumber == 15.0 assert isinstance(inst.myNumber, NumberWithValidations) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py index ce8906fdd13..80bab5b805b 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py @@ -13,10 +13,11 @@ import sys import unittest +import frozendict + import petstore_api -from petstore_api.schemas import Singleton, frozendict +from petstore_api.schemas import Singleton from petstore_api.model.shape import Shape -from petstore_api.model import quadrilateral from petstore_api.model import complex_quadrilateral from petstore_api.model import simple_quadrilateral from petstore_api.model import triangle @@ -52,7 +53,7 @@ class TestShape(unittest.TestCase): assert isinstance(tri, triangle.Triangle) assert isinstance(tri, triangle_interface.TriangleInterface) assert isinstance(tri, Shape) - assert isinstance(tri, frozendict) + assert isinstance(tri, frozendict.frozendict) assert isinstance(tri.shapeType, str) assert isinstance(tri.shapeType, Singleton) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py index 286b5b0f9eb..3d19a8d65fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py @@ -12,12 +12,13 @@ import unittest +import frozendict + from petstore_api.model.equilateral_triangle import EquilateralTriangle from petstore_api.model.isosceles_triangle import IsoscelesTriangle from petstore_api.model.scalene_triangle import ScaleneTriangle from petstore_api.model.triangle import Triangle from petstore_api.model.triangle_interface import TriangleInterface -from petstore_api.schemas import frozendict class TestTriangle(unittest.TestCase): @@ -31,7 +32,7 @@ class TestTriangle(unittest.TestCase): assert isinstance(tri, tri_class) assert isinstance(tri, Triangle) assert isinstance(tri, TriangleInterface) - assert isinstance(tri, frozendict) + assert isinstance(tri, frozendict.frozendict) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py index 69db7b50c9e..194a3bb95c9 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py @@ -4,6 +4,8 @@ from decimal import Decimal from unittest.mock import patch, call import unittest +import frozendict + from petstore_api.model.string_with_validation import StringWithValidation from petstore_api.model.string_enum import StringEnum from petstore_api.model.number_with_validations import NumberWithValidations @@ -29,7 +31,6 @@ from petstore_api.schemas import ( NumberSchema, Schema, ValidationMetadata, - frozendict, ) @@ -76,17 +77,17 @@ class TestValidateResults(unittest.TestCase): def test_empty_dict_validate(self): vm = ValidationMetadata() - path_to_schemas = Foo._validate(frozendict({}), validation_metadata=vm) - assert path_to_schemas == {("args[0]",): {Foo, frozendict}} + path_to_schemas = Foo._validate(frozendict.frozendict({}), validation_metadata=vm) + assert path_to_schemas == {("args[0]",): {Foo, frozendict.frozendict}} def test_dict_validate(self): vm = ValidationMetadata() path_to_schemas = Foo._validate( - frozendict({"bar": "a", "additional": Decimal(0)}), + frozendict.frozendict({"bar": "a", "additional": Decimal(0)}), validation_metadata=vm, ) assert path_to_schemas == { - ("args[0]",): {Foo, frozendict}, + ("args[0]",): {Foo, frozendict.frozendict}, ("args[0]", "bar"): {StrSchema, str}, ("args[0]", "additional"): {AnyTypeSchema, Decimal}, } @@ -94,10 +95,10 @@ class TestValidateResults(unittest.TestCase): def test_discriminated_dict_validate(self): vm = ValidationMetadata() path_to_schemas = Animal._validate( - frozendict(className="Dog", color="black"), validation_metadata=vm + frozendict.frozendict(className="Dog", color="black"), validation_metadata=vm ) assert path_to_schemas == { - ("args[0]",): {Animal, Dog, Dog.MetaOapg.all_of[1], frozendict}, + ("args[0]",): {Animal, Dog, Dog.MetaOapg.all_of[1], frozendict.frozendict}, ("args[0]", "className"): {StrSchema, AnyTypeSchema, str}, ("args[0]", "color"): {StrSchema, AnyTypeSchema, str}, } @@ -110,21 +111,21 @@ class TestValidateResults(unittest.TestCase): def test_oneof_composition_pig_validate(self): vm = ValidationMetadata() path_to_schemas = Pig._validate( - frozendict(className="DanishPig"), validation_metadata=vm + frozendict.frozendict(className="DanishPig"), validation_metadata=vm ) assert path_to_schemas == { - ("args[0]",): {Pig, DanishPig, frozendict}, + ("args[0]",): {Pig, DanishPig, frozendict.frozendict}, ("args[0]", "className"): {DanishPig.MetaOapg.properties.className, AnyTypeSchema, str}, } def test_anyof_composition_gm_fruit_validate(self): vm = ValidationMetadata() path_to_schemas = GmFruit._validate( - frozendict(cultivar="GoldenDelicious", lengthCm=Decimal(10)), + frozendict.frozendict(cultivar="GoldenDelicious", lengthCm=Decimal(10)), validation_metadata=vm, ) assert path_to_schemas == { - ("args[0]",): {GmFruit, Apple, Banana, frozendict}, + ("args[0]",): {GmFruit, Apple, Banana, frozendict.frozendict}, ("args[0]", "cultivar"): {Apple.MetaOapg.properties.cultivar, AnyTypeSchema, str}, ("args[0]", "lengthCm"): {AnyTypeSchema, NumberSchema, Decimal}, } @@ -146,7 +147,7 @@ class TestValidateCalls(unittest.TestCase): assert mock_validate.call_count == 1 def test_empty_dict_validate(self): - return_value = {("args[0]",): {Foo, frozendict}} + return_value = {("args[0]",): {Foo, frozendict.frozendict}} with patch.object( Schema, "_validate", return_value=return_value ) as mock_validate: @@ -217,14 +218,14 @@ class TestValidateCalls(unittest.TestCase): def test_dict_validate_direct_instantiation(self): call_results = [ - {("args[0]",): {Foo, frozendict}}, + {("args[0]",): {Foo, frozendict.frozendict}}, {("args[0]", "bar"): {StrSchema, str}} ] with patch.object(Schema, "_validate", side_effect=call_results) as mock_validate: Foo(bar="a") calls = [ call( - frozendict({"bar": "a"}), + frozendict.frozendict({"bar": "a"}), validation_metadata=ValidationMetadata(path_to_item=("args[0]",)), ), call( @@ -239,13 +240,13 @@ class TestValidateCalls(unittest.TestCase): def test_dict_validate_direct_instantiation_cast_item(self): bar = StrSchema("a") return_value = { - ("args[0]",): {Foo, frozendict} + ("args[0]",): {Foo, frozendict.frozendict} } # only the Foo dict is validated because the bar property value was already validated with patch.object(Schema, "_validate", return_value=return_value) as mock_validate: Foo(bar=bar) mock_validate.assert_called_once_with( - frozendict(dict(bar='a')), + frozendict.frozendict(dict(bar='a')), validation_metadata=ValidationMetadata( validated_path_to_schemas={('args[0]', 'bar'): {str, StrSchema}} ) @@ -254,14 +255,14 @@ class TestValidateCalls(unittest.TestCase): def test_dict_validate_from_openapi_data_instantiation(self): return_values = [ - {("args[0]",): {Foo, frozendict}}, + {("args[0]",): {Foo, frozendict.frozendict}}, {("args[0]", 'bar'): {StrSchema, str}} ] with patch.object(Schema, "_validate", side_effect=return_values) as mock_validate: Foo._from_openapi_data({"bar": "a"}) calls = [ call( - frozendict({"bar": "a"}), + frozendict.frozendict({"bar": "a"}), validation_metadata=ValidationMetadata(path_to_item=("args[0]",), from_server=True), ), call(