From d1c22307094a0c42b56f113510a19361a182fec4 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Thu, 21 Jul 2022 15:34:49 -0700 Subject: [PATCH] v303 unit test spec, adds post json request bodies (#12875) * Adds post request body routes and test data to spec * Sample regenerated * Adds tags and post endpoints * Uses refs to tests examples in requestBodies * Stops passing in test_examples into generate_operation * Adds testCases to MediaType * Adds refs to test cases in media type * Adds post request body examples * Fixes enum 1 ingestion of 1.0 * Only generates test examples when they exist * Regenerates samples --- .../codegen/CodegenMediaType.java | 9 +- .../openapitools/codegen/DefaultCodegen.java | 35 +- .../PythonExperimentalClientCodegen.java | 26 +- .../__init__test.handlebars | 68 + .../python-experimental/api_test.handlebars | 97 +- .../python-experimental/endpoint.handlebars | 2 +- .../python-experimental/schemas.handlebars | 19 +- .../unit_test_spec/3_0_3_unit_test_spec.yaml | 1520 ++- .../3_0/unit_test_spec/spec_writer.py | 136 +- .../.openapi-generator/FILES | 9 + .../python-experimental/README.md | 345 +- .../python-experimental/docs/JsonApi.md | 6243 +++++++++ .../python-experimental/docs/PostApi.md | 6243 +++++++++ .../docs/RequestBodyApi.md | 6243 +++++++++ .../python-experimental/test/__init__.py | 68 + .../python-experimental/test/test_json_api.py | 10585 ++++++++++++++++ .../python-experimental/test/test_post_api.py | 10585 ++++++++++++++++ .../test/test_request_body_api.py | 10585 ++++++++++++++++ .../unit_test_api/api/__init__.py | 3 + .../unit_test_api/api/json_api.py | 191 + .../api/json_api_endpoints/__init__.py | 3 + ...hema_which_should_validate_request_body.py | 157 + ...ies_are_allowed_by_default_request_body.py | 157 + ...erties_can_exist_by_itself_request_body.py | 157 + ...ld_not_look_in_applicators_request_body.py | 157 + ..._combined_with_anyof_oneof_request_body.py | 157 + .../post_allof_request_body.py | 157 + .../post_allof_simple_types_request_body.py | 157 + ...ost_allof_with_base_schema_request_body.py | 157 + ...llof_with_one_empty_schema_request_body.py | 157 + ...ith_the_first_empty_schema_request_body.py | 157 + ...with_the_last_empty_schema_request_body.py | 157 + ...lof_with_two_empty_schemas_request_body.py | 157 + .../post_anyof_complex_types_request_body.py | 157 + .../post_anyof_request_body.py | 157 + ...ost_anyof_with_base_schema_request_body.py | 157 + ...nyof_with_one_empty_schema_request_body.py | 157 + ..._array_type_matches_arrays_request_body.py | 157 + ...lean_type_matches_booleans_request_body.py | 155 + .../post_by_int_request_body.py | 157 + .../post_by_number_request_body.py | 157 + .../post_by_small_number_request_body.py | 157 + .../post_date_time_format_request_body.py | 155 + .../post_email_format_request_body.py | 155 + ...with0_does_not_match_false_request_body.py | 157 + ..._with1_does_not_match_true_request_body.py | 157 + ...um_with_escaped_characters_request_body.py | 157 + ...with_false_does_not_match0_request_body.py | 157 + ..._with_true_does_not_match1_request_body.py | 157 + .../post_enums_in_properties_request_body.py | 157 + .../post_forbidden_property_request_body.py | 157 + .../post_hostname_format_request_body.py | 155 + ...eger_type_matches_integers_request_body.py | 155 + ...or_when_float_division_inf_request_body.py | 157 + ...d_string_value_for_default_request_body.py | 157 + .../post_ipv4_format_request_body.py | 155 + .../post_ipv6_format_request_body.py | 155 + .../post_json_pointer_format_request_body.py | 155 + .../post_maximum_validation_request_body.py | 157 + ...tion_with_unsigned_integer_request_body.py | 157 + .../post_maxitems_validation_request_body.py | 157 + .../post_maxlength_validation_request_body.py | 157 + ..._means_the_object_is_empty_request_body.py | 157 + ...t_maxproperties_validation_request_body.py | 157 + .../post_minimum_validation_request_body.py | 157 + ...dation_with_signed_integer_request_body.py | 157 + .../post_minitems_validation_request_body.py | 157 + .../post_minlength_validation_request_body.py | 157 + ...t_minproperties_validation_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + .../post_nested_items_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...st_not_more_complex_schema_request_body.py | 216 + .../post_not_request_body.py | 195 + ..._nul_characters_in_strings_request_body.py | 157 + ...tches_only_the_null_object_request_body.py | 155 + ...umber_type_matches_numbers_request_body.py | 155 + ...ject_properties_validation_request_body.py | 157 + ...bject_type_matches_objects_request_body.py | 155 + .../post_oneof_complex_types_request_body.py | 157 + .../post_oneof_request_body.py | 157 + ...ost_oneof_with_base_schema_request_body.py | 157 + ...st_oneof_with_empty_schema_request_body.py | 157 + ...st_pattern_is_not_anchored_request_body.py | 157 + .../post_pattern_validation_request_body.py | 157 + ...es_with_escaped_characters_request_body.py | 157 + ...ef_that_is_not_a_reference_request_body.py | 157 + ...ef_in_additionalproperties_request_body.py | 157 + .../post_ref_in_allof_request_body.py | 157 + .../post_ref_in_anyof_request_body.py | 157 + .../post_ref_in_items_request_body.py | 157 + .../post_ref_in_oneof_request_body.py | 157 + .../post_ref_in_property_request_body.py | 157 + ...equired_default_validation_request_body.py | 157 + .../post_required_validation_request_body.py | 157 + ..._required_with_empty_array_request_body.py | 157 + ...ost_simple_enum_validation_request_body.py | 157 + ...tring_type_matches_strings_request_body.py | 155 + ...if_the_property_is_missing_request_body.py | 157 + ...iqueitems_false_validation_request_body.py | 157 + ...ost_uniqueitems_validation_request_body.py | 157 + .../post_uri_format_request_body.py | 155 + .../post_uri_reference_format_request_body.py | 155 + .../post_uri_template_format_request_body.py | 155 + .../unit_test_api/api/post_api.py | 191 + .../api/post_api_endpoints/__init__.py | 3 + ...hema_which_should_validate_request_body.py | 157 + ...ies_are_allowed_by_default_request_body.py | 157 + ...erties_can_exist_by_itself_request_body.py | 157 + ...ld_not_look_in_applicators_request_body.py | 157 + ..._combined_with_anyof_oneof_request_body.py | 157 + .../post_allof_request_body.py | 157 + .../post_allof_simple_types_request_body.py | 157 + ...ost_allof_with_base_schema_request_body.py | 157 + ...llof_with_one_empty_schema_request_body.py | 157 + ...ith_the_first_empty_schema_request_body.py | 157 + ...with_the_last_empty_schema_request_body.py | 157 + ...lof_with_two_empty_schemas_request_body.py | 157 + .../post_anyof_complex_types_request_body.py | 157 + .../post_anyof_request_body.py | 157 + ...ost_anyof_with_base_schema_request_body.py | 157 + ...nyof_with_one_empty_schema_request_body.py | 157 + ..._array_type_matches_arrays_request_body.py | 157 + ...lean_type_matches_booleans_request_body.py | 155 + .../post_by_int_request_body.py | 157 + .../post_by_number_request_body.py | 157 + .../post_by_small_number_request_body.py | 157 + .../post_date_time_format_request_body.py | 155 + .../post_email_format_request_body.py | 155 + ...with0_does_not_match_false_request_body.py | 157 + ..._with1_does_not_match_true_request_body.py | 157 + ...um_with_escaped_characters_request_body.py | 157 + ...with_false_does_not_match0_request_body.py | 157 + ..._with_true_does_not_match1_request_body.py | 157 + .../post_enums_in_properties_request_body.py | 157 + .../post_forbidden_property_request_body.py | 157 + .../post_hostname_format_request_body.py | 155 + ...eger_type_matches_integers_request_body.py | 155 + ...or_when_float_division_inf_request_body.py | 157 + ...d_string_value_for_default_request_body.py | 157 + .../post_ipv4_format_request_body.py | 155 + .../post_ipv6_format_request_body.py | 155 + .../post_json_pointer_format_request_body.py | 155 + .../post_maximum_validation_request_body.py | 157 + ...tion_with_unsigned_integer_request_body.py | 157 + .../post_maxitems_validation_request_body.py | 157 + .../post_maxlength_validation_request_body.py | 157 + ..._means_the_object_is_empty_request_body.py | 157 + ...t_maxproperties_validation_request_body.py | 157 + .../post_minimum_validation_request_body.py | 157 + ...dation_with_signed_integer_request_body.py | 157 + .../post_minitems_validation_request_body.py | 157 + .../post_minlength_validation_request_body.py | 157 + ...t_minproperties_validation_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + .../post_nested_items_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...st_not_more_complex_schema_request_body.py | 216 + .../post_not_request_body.py | 195 + ..._nul_characters_in_strings_request_body.py | 157 + ...tches_only_the_null_object_request_body.py | 155 + ...umber_type_matches_numbers_request_body.py | 155 + ...ject_properties_validation_request_body.py | 157 + ...bject_type_matches_objects_request_body.py | 155 + .../post_oneof_complex_types_request_body.py | 157 + .../post_oneof_request_body.py | 157 + ...ost_oneof_with_base_schema_request_body.py | 157 + ...st_oneof_with_empty_schema_request_body.py | 157 + ...st_pattern_is_not_anchored_request_body.py | 157 + .../post_pattern_validation_request_body.py | 157 + ...es_with_escaped_characters_request_body.py | 157 + ...ef_that_is_not_a_reference_request_body.py | 157 + ...ef_in_additionalproperties_request_body.py | 157 + .../post_ref_in_allof_request_body.py | 157 + .../post_ref_in_anyof_request_body.py | 157 + .../post_ref_in_items_request_body.py | 157 + .../post_ref_in_oneof_request_body.py | 157 + .../post_ref_in_property_request_body.py | 157 + ...equired_default_validation_request_body.py | 157 + .../post_required_validation_request_body.py | 157 + ..._required_with_empty_array_request_body.py | 157 + ...ost_simple_enum_validation_request_body.py | 157 + ...tring_type_matches_strings_request_body.py | 155 + ...if_the_property_is_missing_request_body.py | 157 + ...iqueitems_false_validation_request_body.py | 157 + ...ost_uniqueitems_validation_request_body.py | 157 + .../post_uri_format_request_body.py | 155 + .../post_uri_reference_format_request_body.py | 155 + .../post_uri_template_format_request_body.py | 155 + .../unit_test_api/api/request_body_api.py | 191 + .../request_body_api_endpoints/__init__.py | 3 + ...hema_which_should_validate_request_body.py | 157 + ...ies_are_allowed_by_default_request_body.py | 157 + ...erties_can_exist_by_itself_request_body.py | 157 + ...ld_not_look_in_applicators_request_body.py | 157 + ..._combined_with_anyof_oneof_request_body.py | 157 + .../post_allof_request_body.py | 157 + .../post_allof_simple_types_request_body.py | 157 + ...ost_allof_with_base_schema_request_body.py | 157 + ...llof_with_one_empty_schema_request_body.py | 157 + ...ith_the_first_empty_schema_request_body.py | 157 + ...with_the_last_empty_schema_request_body.py | 157 + ...lof_with_two_empty_schemas_request_body.py | 157 + .../post_anyof_complex_types_request_body.py | 157 + .../post_anyof_request_body.py | 157 + ...ost_anyof_with_base_schema_request_body.py | 157 + ...nyof_with_one_empty_schema_request_body.py | 157 + ..._array_type_matches_arrays_request_body.py | 157 + ...lean_type_matches_booleans_request_body.py | 155 + .../post_by_int_request_body.py | 157 + .../post_by_number_request_body.py | 157 + .../post_by_small_number_request_body.py | 157 + .../post_date_time_format_request_body.py | 155 + .../post_email_format_request_body.py | 155 + ...with0_does_not_match_false_request_body.py | 157 + ..._with1_does_not_match_true_request_body.py | 157 + ...um_with_escaped_characters_request_body.py | 157 + ...with_false_does_not_match0_request_body.py | 157 + ..._with_true_does_not_match1_request_body.py | 157 + .../post_enums_in_properties_request_body.py | 157 + .../post_forbidden_property_request_body.py | 157 + .../post_hostname_format_request_body.py | 155 + ...eger_type_matches_integers_request_body.py | 155 + ...or_when_float_division_inf_request_body.py | 157 + ...d_string_value_for_default_request_body.py | 157 + .../post_ipv4_format_request_body.py | 155 + .../post_ipv6_format_request_body.py | 155 + .../post_json_pointer_format_request_body.py | 155 + .../post_maximum_validation_request_body.py | 157 + ...tion_with_unsigned_integer_request_body.py | 157 + .../post_maxitems_validation_request_body.py | 157 + .../post_maxlength_validation_request_body.py | 157 + ..._means_the_object_is_empty_request_body.py | 157 + ...t_maxproperties_validation_request_body.py | 157 + .../post_minimum_validation_request_body.py | 157 + ...dation_with_signed_integer_request_body.py | 157 + .../post_minitems_validation_request_body.py | 157 + .../post_minlength_validation_request_body.py | 157 + ...t_minproperties_validation_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + .../post_nested_items_request_body.py | 157 + ...check_validation_semantics_request_body.py | 157 + ...st_not_more_complex_schema_request_body.py | 216 + .../post_not_request_body.py | 195 + ..._nul_characters_in_strings_request_body.py | 157 + ...tches_only_the_null_object_request_body.py | 155 + ...umber_type_matches_numbers_request_body.py | 155 + ...ject_properties_validation_request_body.py | 157 + ...bject_type_matches_objects_request_body.py | 155 + .../post_oneof_complex_types_request_body.py | 157 + .../post_oneof_request_body.py | 157 + ...ost_oneof_with_base_schema_request_body.py | 157 + ...st_oneof_with_empty_schema_request_body.py | 157 + ...st_pattern_is_not_anchored_request_body.py | 157 + .../post_pattern_validation_request_body.py | 157 + ...es_with_escaped_characters_request_body.py | 157 + ...ef_that_is_not_a_reference_request_body.py | 157 + ...ef_in_additionalproperties_request_body.py | 157 + .../post_ref_in_allof_request_body.py | 157 + .../post_ref_in_anyof_request_body.py | 157 + .../post_ref_in_items_request_body.py | 157 + .../post_ref_in_oneof_request_body.py | 157 + .../post_ref_in_property_request_body.py | 157 + ...equired_default_validation_request_body.py | 157 + .../post_required_validation_request_body.py | 157 + ..._required_with_empty_array_request_body.py | 157 + ...ost_simple_enum_validation_request_body.py | 157 + ...tring_type_matches_strings_request_body.py | 155 + ...if_the_property_is_missing_request_body.py | 157 + ...iqueitems_false_validation_request_body.py | 157 + ...ost_uniqueitems_validation_request_body.py | 157 + .../post_uri_format_request_body.py | 155 + .../post_uri_reference_format_request_body.py | 155 + .../post_uri_template_format_request_body.py | 155 + .../unit_test_api/apis/__init__.py | 20 + .../unit_test_api/configuration.py | 4 +- .../unit_test_api/schemas.py | 19 +- .../petstore_api/schemas.py | 19 +- .../python-experimental/test/__init__.py | 68 + 282 files changed, 93222 insertions(+), 76 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__test.handlebars create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/JsonApi.md create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/PostApi.md create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/RequestBodyApi.md create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_json_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_post_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_request_body_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/__init__.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_simple_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_two_empty_schemas_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_array_type_matches_arrays_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_boolean_type_matches_booleans_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_int_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_small_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_date_time_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_email_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with0_does_not_match_false_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with1_does_not_match_true_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_false_does_not_match0_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_true_does_not_match1_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enums_in_properties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_forbidden_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_hostname_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_integer_type_matches_integers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_string_value_for_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv4_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv6_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_json_pointer_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_more_complex_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nul_characters_in_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_number_type_matches_numbers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_properties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_type_matches_objects_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_is_not_anchored_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_properties_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_additionalproperties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_default_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_with_empty_array_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_simple_enum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_string_type_matches_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_false_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_reference_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_template_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/__init__.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_simple_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_two_empty_schemas_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_array_type_matches_arrays_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_boolean_type_matches_booleans_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_int_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_small_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_date_time_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_email_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with0_does_not_match_false_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with1_does_not_match_true_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_false_does_not_match0_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_true_does_not_match1_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enums_in_properties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_forbidden_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_hostname_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_integer_type_matches_integers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_string_value_for_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv4_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv6_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_json_pointer_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_more_complex_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nul_characters_in_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_number_type_matches_numbers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_properties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_type_matches_objects_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_is_not_anchored_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_properties_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_additionalproperties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_default_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_with_empty_array_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_simple_enum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_string_type_matches_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_false_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_reference_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_template_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/__init__.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_simple_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_two_empty_schemas_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_one_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_array_type_matches_arrays_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_boolean_type_matches_booleans_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_int_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_small_number_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_date_time_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_email_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with0_does_not_match_false_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with1_does_not_match_true_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_false_does_not_match0_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_true_does_not_match1_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enums_in_properties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_forbidden_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_hostname_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_integer_type_matches_integers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_string_value_for_default_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv4_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv6_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_json_pointer_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minlength_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minproperties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_more_complex_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nul_characters_in_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_number_type_matches_numbers_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_properties_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_type_matches_objects_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_complex_types_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_base_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_empty_schema_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_is_not_anchored_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_properties_with_escaped_characters_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_additionalproperties_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_allof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_anyof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_items_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_oneof_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_property_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_default_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_with_empty_array_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_simple_enum_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_string_type_matches_strings_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_false_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_validation_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_reference_format_request_body.py create mode 100644 samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_template_format_request_body.py diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java index 965e5031942..2728bc632fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java @@ -1,15 +1,20 @@ package org.openapitools.codegen; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Objects; public class CodegenMediaType { private CodegenProperty schema; private LinkedHashMap encoding; + private HashMap testCases = new HashMap<>(); - public CodegenMediaType(CodegenProperty schema, LinkedHashMap encoding) { + public CodegenMediaType(CodegenProperty schema, LinkedHashMap encoding, HashMap testCases) { this.schema = schema; this.encoding = encoding; + if (testCases != null) { + this.testCases = testCases; + } } public CodegenProperty getSchema() { @@ -20,6 +25,8 @@ public class CodegenMediaType { return encoding; } + public HashMap getTestCases() { return testCases; } + public String toString() { final StringBuilder sb = new StringBuilder("CodegenMediaType{"); sb.append("schema=").append(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 87aaf95c6f2..563b09e4982 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -90,6 +90,8 @@ public class DefaultCodegen implements CodegenConfig { // A cache of sanitized words. The sanitizeName() method is invoked many times with the same // arguments, this cache is used to optimized performance. private static Cache sanitizedNameCache; + private static final String xSchemaTestExamplesKey = "x-schema-test-examples"; + private static final String xSchemaTestExamplesRefPrefix = "#/components/x-schema-test-examples/"; static { DefaultFeatureSet = FeatureSet.newBuilder() @@ -2729,17 +2731,20 @@ public class DefaultCodegen implements CodegenConfig { /** * Processes any test cases if they exist in the components.x-test-examples vendor extensions * If they exist then cast them to java class instances and return them back in a map - * @param schemaName the component schema name that the test cases are for - * @param vendorExtensions the extensions that may or may not hold the data + * @param refToTestCases the component schema name that the test cases are for */ - private HashMap extractSchemaTestCases(String schemaName, HashMap vendorExtensions) { - String testExamplesKey = "x-schema-test-examples"; + private HashMap extractSchemaTestCases(String refToTestCases) { // schemaName to a map of test case name to test case - if (vendorExtensions == null || !vendorExtensions.containsKey(testExamplesKey)) { + HashMap vendorExtensions = (HashMap) openAPI.getComponents().getExtensions(); + if (vendorExtensions == null || !vendorExtensions.containsKey(xSchemaTestExamplesKey)) { return null; } + if (!refToTestCases.startsWith(xSchemaTestExamplesRefPrefix)) { + return null; + } + String schemaName = refToTestCases.substring(xSchemaTestExamplesRefPrefix.length()); HashMap schemaTestCases = new HashMap<>(); - LinkedHashMap schemaNameToTestCases = (LinkedHashMap) vendorExtensions.get(testExamplesKey); + LinkedHashMap schemaNameToTestCases = (LinkedHashMap) vendorExtensions.get(xSchemaTestExamplesKey); if (!schemaNameToTestCases.containsKey(schemaName)) { return null; @@ -2784,8 +2789,7 @@ public class DefaultCodegen implements CodegenConfig { CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL); ModelUtils.syncValidationProperties(schema, m); if (openAPI != null) { - HashMap vendorExtensions = (HashMap) openAPI.getComponents().getExtensions(); - HashMap schemaTestCases = extractSchemaTestCases(name, vendorExtensions); + HashMap schemaTestCases = extractSchemaTestCases(xSchemaTestExamplesRefPrefix + name); m.testCases = schemaTestCases; } @@ -6969,7 +6973,20 @@ public class DefaultCodegen implements CodegenConfig { if (mt.getSchema() != null) { schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema(), false); } - CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); + HashMap schemaTestCases = null; + if (mt.getExtensions() != null && mt.getExtensions().containsKey(xSchemaTestExamplesKey)) { + Object objNodeWithRef = mt.getExtensions().get(xSchemaTestExamplesKey); + if (objNodeWithRef instanceof LinkedHashMap) { + LinkedHashMap nodeWithRef = (LinkedHashMap) objNodeWithRef; + String refKey = "$ref"; + String refToTestCases = nodeWithRef.getOrDefault(refKey, null); + if (refToTestCases != null) { + schemaTestCases = extractSchemaTestCases(refToTestCases); + } + } + } + + CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap, schemaTestCases); cmtContent.put(contentType, codegenMt); if (schemaProp != null) { addImports(imports, schemaProp.getImports(false)); 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 9f24ff08d90..ac1ae9a7c28 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 @@ -377,7 +377,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { supportingFiles.add(new SupportingFile("exceptions." + templateExtension, packagePath(), "exceptions.py")); if (Boolean.FALSE.equals(excludeTests)) { - supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__test." + templateExtension, testFolder, "__init__.py")); } supportingFiles.add(new SupportingFile("api_client." + templateExtension, packagePath(), "api_client.py")); @@ -2240,21 +2240,23 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { */ public void postProcessPattern(String pattern, Map vendorExtensions) { if (pattern != null) { + int regexLength = pattern.length(); + String regex = pattern; int i = pattern.lastIndexOf('/'); - - //Must follow Perl /pattern/modifiers convention - if (pattern.charAt(0) != '/' || i < 2) { - throw new IllegalArgumentException("Pattern must follow the Perl " - + "/pattern/modifiers convention. " + pattern + " is not valid."); + if (regexLength >= 2 && pattern.charAt(0) == '/' && i != -1) { + // json schema tests do not include the leading and trailing slashes + // so I do not think that they are required + regex = pattern.substring(1, i); } - - String regex = pattern.substring(1, i).replace("'", "\\'"); + regex = regex.replace("'", "\\'"); List modifiers = new ArrayList(); - for (char c : pattern.substring(i).toCharArray()) { - if (regexModifiers.containsKey(c)) { - String modifier = regexModifiers.get(c); - modifiers.add(modifier); + if (i != -1) { + for (char c : pattern.substring(i).toCharArray()) { + if (regexModifiers.containsKey(c)) { + String modifier = regexModifiers.get(c); + modifiers.add(modifier); + } } } diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__test.handlebars new file mode 100644 index 00000000000..2d2e1b5c730 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__test.handlebars @@ -0,0 +1,68 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = 'application/json', + accept_content_type: typing.Optional[str] = 'application/json', + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars index 2f52783c605..0ce4c0304d5 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars @@ -3,21 +3,29 @@ {{>partial_header}} import unittest +from unittest.mock import patch + +import urllib3 import {{packageName}} from {{packageName}}.{{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 +from {{packageName}} import configuration, schemas, api_client + +from . import ApiTestMixin -class {{#with operations}}Test{{classname}}(unittest.TestCase): +class {{#with operations}}Test{{classname}}(ApiTestMixin, unittest.TestCase): """{{classname}} unit test stubs""" + _configuration = configuration.Configuration() def setUp(self): - self.api = {{classname}}() # noqa: E501 + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = {{classname}}(api_client=used_api_client) # noqa: E501 def tearDown(self): pass - {{#each operation}} +{{#each operation}} def test_{{operationId}}(self): """Test case for {{{operationId}}} @@ -25,9 +33,88 @@ class {{#with operations}}Test{{classname}}(unittest.TestCase): {{{summary}}} # noqa: E501 {{/if}} """ - pass + from {{packageName}}.{{apiPackage}}.{{classFilename}}_endpoints import {{operationId}} as endpoint_module +{{#each responses}} +{{#if @first}} + response_status = {{code}} +{{#if content}} +{{#each content}} + # TODO get response content working +{{/each}} +{{else}} + response_body = '' +{{/if}} +{{/if}} +{{/each}} +{{#if bodyParam}} +{{#with bodyParam}} +{{#if required}} +{{#each content}} + content_type = '{{{@key}}}' +{{#if this.testCases}} - {{/each}} +{{#each testCases}} +{{#with this }} + # test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}} + # {{description}} + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( +{{#with data}} + {{> model_templates/payload_renderer endChar='' }} +{{/with}} + ) +{{#if valid}} + body = endpoint_module.{{schema.baseName}}._from_openapi_data( +{{#with data}} + request_payload, +{{/with}} + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.{{operationId}}( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '{{{path}}}', + method='{{httpMethod}}', + body=self.json_bytes(request_payload), + content_type=content_type, + {{#unless produces}} + accept_content_type=None, + {{/unless}} + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) +{{else}} + with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): + body = endpoint_module.{{schema.baseName}}._from_openapi_data( +{{#with data}} + {{> model_templates/payload_renderer endChar=',' }} +{{/with}} + _configuration=self._configuration + ) + self.api.{{operationId}}(body=body) +{{/if}} +{{/with}} + +{{/each}} + +{{/if}} +{{/each}} +{{/if}} +{{/with}} +{{else}} + pass +{{/if}} + +{{/each}} {{/with}} if __name__ == '__main__': 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 cb2c0191b32..e7754547d74 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars @@ -373,7 +373,7 @@ class {{operationIdCamelCase}}(api_client.Api): self: api_client.Api, {{#if bodyParam}} {{#with bodyParam}} - {{baseName}}: typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{this.schema.baseName}}{{/each}}{{#unless required}}, Unset] = unset{{else}}]{{/unless}}, + body: typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{this.schema.baseName}}{{/each}}{{#unless required}}, Unset] = unset{{else}}]{{/unless}}, {{/with}} {{/if}} {{#if queryParams}} 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 7e442ffca88..7405a1c3203 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -372,15 +372,18 @@ class Singleton: _instances = {} def __new__(cls, arg: typing.Any, **kwargs): - key = (cls, arg) + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg, str(arg)) if key not in cls._instances: - if arg in {None, True, False}: - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, BoolClass): - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, NoneClass): + if isinstance(arg, (none_type, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: diff --git a/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml b/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml index d3ff930a908..8fa24405035 100644 --- a/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml @@ -1,10 +1,1526 @@ openapi: 3.0.3 +servers: +- url: https://someserver.com/v1 info: title: openapi 3.0.3 sample spec + version: 0.0.1 description: sample spec for testing openapi functionality, built from json schema tests for draft6 - version: 0.0.1 -paths: {} +tags: +- name: requestBody +paths: + /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody: + post: + operationId: postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AdditionalpropertiesAllowsASchemaWhichShouldValidate' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody: + post: + operationId: postAdditionalpropertiesCanExistByItselfRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalpropertiesCanExistByItself' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AdditionalpropertiesCanExistByItself' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody: + post: + operationId: postAdditionalpropertiesAreAllowedByDefaultRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalpropertiesAreAllowedByDefault' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AdditionalpropertiesAreAllowedByDefault' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody: + post: + operationId: postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalpropertiesShouldNotLookInApplicators' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AdditionalpropertiesShouldNotLookInApplicators' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofRequestBody: + post: + operationId: postAllofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Allof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Allof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofWithBaseSchemaRequestBody: + post: + operationId: postAllofWithBaseSchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofWithBaseSchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofWithBaseSchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofSimpleTypesRequestBody: + post: + operationId: postAllofSimpleTypesRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofSimpleTypes' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofSimpleTypes' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofWithOneEmptySchemaRequestBody: + post: + operationId: postAllofWithOneEmptySchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofWithOneEmptySchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofWithOneEmptySchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofWithTwoEmptySchemasRequestBody: + post: + operationId: postAllofWithTwoEmptySchemasRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofWithTwoEmptySchemas' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofWithTwoEmptySchemas' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofWithTheFirstEmptySchemaRequestBody: + post: + operationId: postAllofWithTheFirstEmptySchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofWithTheFirstEmptySchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofWithTheFirstEmptySchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofWithTheLastEmptySchemaRequestBody: + post: + operationId: postAllofWithTheLastEmptySchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofWithTheLastEmptySchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofWithTheLastEmptySchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody: + post: + operationId: postNestedAllofToCheckValidationSemanticsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NestedAllofToCheckValidationSemantics' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NestedAllofToCheckValidationSemantics' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAllofCombinedWithAnyofOneofRequestBody: + post: + operationId: postAllofCombinedWithAnyofOneofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AllofCombinedWithAnyofOneof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AllofCombinedWithAnyofOneof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAnyofRequestBody: + post: + operationId: postAnyofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Anyof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Anyof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAnyofWithBaseSchemaRequestBody: + post: + operationId: postAnyofWithBaseSchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnyofWithBaseSchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AnyofWithBaseSchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAnyofComplexTypesRequestBody: + post: + operationId: postAnyofComplexTypesRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnyofComplexTypes' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AnyofComplexTypes' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postAnyofWithOneEmptySchemaRequestBody: + post: + operationId: postAnyofWithOneEmptySchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnyofWithOneEmptySchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/AnyofWithOneEmptySchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody: + post: + operationId: postNestedAnyofToCheckValidationSemanticsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NestedAnyofToCheckValidationSemantics' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NestedAnyofToCheckValidationSemantics' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postInvalidStringValueForDefaultRequestBody: + post: + operationId: postInvalidStringValueForDefaultRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidStringValueForDefault' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/InvalidStringValueForDefault' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody: + post: + operationId: postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postSimpleEnumValidationRequestBody: + post: + operationId: postSimpleEnumValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SimpleEnumValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/SimpleEnumValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumsInPropertiesRequestBody: + post: + operationId: postEnumsInPropertiesRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumsInProperties' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumsInProperties' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumWithEscapedCharactersRequestBody: + post: + operationId: postEnumWithEscapedCharactersRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumWithEscapedCharacters' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumWithEscapedCharacters' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumWithFalseDoesNotMatch0RequestBody: + post: + operationId: postEnumWithFalseDoesNotMatch0RequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumWithFalseDoesNotMatch0' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumWithFalseDoesNotMatch0' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumWithTrueDoesNotMatch1RequestBody: + post: + operationId: postEnumWithTrueDoesNotMatch1RequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumWithTrueDoesNotMatch1' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumWithTrueDoesNotMatch1' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumWith0DoesNotMatchFalseRequestBody: + post: + operationId: postEnumWith0DoesNotMatchFalseRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumWith0DoesNotMatchFalse' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumWith0DoesNotMatchFalse' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEnumWith1DoesNotMatchTrueRequestBody: + post: + operationId: postEnumWith1DoesNotMatchTrueRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnumWith1DoesNotMatchTrue' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EnumWith1DoesNotMatchTrue' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNulCharactersInStringsRequestBody: + post: + operationId: postNulCharactersInStringsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NulCharactersInStrings' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NulCharactersInStrings' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postEmailFormatRequestBody: + post: + operationId: postEmailFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EmailFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/EmailFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postIpv4FormatRequestBody: + post: + operationId: postIpv4FormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Ipv4Format' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Ipv4Format' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postIpv6FormatRequestBody: + post: + operationId: postIpv6FormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Ipv6Format' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Ipv6Format' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postHostnameFormatRequestBody: + post: + operationId: postHostnameFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HostnameFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/HostnameFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postDateTimeFormatRequestBody: + post: + operationId: postDateTimeFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DateTimeFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/DateTimeFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postJsonPointerFormatRequestBody: + post: + operationId: postJsonPointerFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JsonPointerFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/JsonPointerFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postUriFormatRequestBody: + post: + operationId: postUriFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UriFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/UriFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postUriReferenceFormatRequestBody: + post: + operationId: postUriReferenceFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UriReferenceFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/UriReferenceFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postUriTemplateFormatRequestBody: + post: + operationId: postUriTemplateFormatRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UriTemplateFormat' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/UriTemplateFormat' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNestedItemsRequestBody: + post: + operationId: postNestedItemsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NestedItems' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NestedItems' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaximumValidationRequestBody: + post: + operationId: postMaximumValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaximumValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MaximumValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody: + post: + operationId: postMaximumValidationWithUnsignedIntegerRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaximumValidationWithUnsignedInteger' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MaximumValidationWithUnsignedInteger' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaxitemsValidationRequestBody: + post: + operationId: postMaxitemsValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaxitemsValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MaxitemsValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaxlengthValidationRequestBody: + post: + operationId: postMaxlengthValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaxlengthValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MaxlengthValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaxpropertiesValidationRequestBody: + post: + operationId: postMaxpropertiesValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaxpropertiesValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MaxpropertiesValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody: + post: + operationId: postMaxproperties0MeansTheObjectIsEmptyRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Maxproperties0MeansTheObjectIsEmpty' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Maxproperties0MeansTheObjectIsEmpty' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMinimumValidationRequestBody: + post: + operationId: postMinimumValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MinimumValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MinimumValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMinimumValidationWithSignedIntegerRequestBody: + post: + operationId: postMinimumValidationWithSignedIntegerRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MinimumValidationWithSignedInteger' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MinimumValidationWithSignedInteger' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMinitemsValidationRequestBody: + post: + operationId: postMinitemsValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MinitemsValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MinitemsValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMinlengthValidationRequestBody: + post: + operationId: postMinlengthValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MinlengthValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MinlengthValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postMinpropertiesValidationRequestBody: + post: + operationId: postMinpropertiesValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MinpropertiesValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/MinpropertiesValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postByIntRequestBody: + post: + operationId: postByIntRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ByInt' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ByInt' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postByNumberRequestBody: + post: + operationId: postByNumberRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ByNumber' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ByNumber' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postBySmallNumberRequestBody: + post: + operationId: postBySmallNumberRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BySmallNumber' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/BySmallNumber' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody: + post: + operationId: postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNotRequestBody: + post: + operationId: postNotRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Not' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Not' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNotMoreComplexSchemaRequestBody: + post: + operationId: postNotMoreComplexSchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotMoreComplexSchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NotMoreComplexSchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postForbiddenPropertyRequestBody: + post: + operationId: postForbiddenPropertyRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenProperty' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ForbiddenProperty' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postOneofRequestBody: + post: + operationId: postOneofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Oneof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/Oneof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postOneofWithBaseSchemaRequestBody: + post: + operationId: postOneofWithBaseSchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OneofWithBaseSchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/OneofWithBaseSchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postOneofComplexTypesRequestBody: + post: + operationId: postOneofComplexTypesRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OneofComplexTypes' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/OneofComplexTypes' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postOneofWithEmptySchemaRequestBody: + post: + operationId: postOneofWithEmptySchemaRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OneofWithEmptySchema' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/OneofWithEmptySchema' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody: + post: + operationId: postNestedOneofToCheckValidationSemanticsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NestedOneofToCheckValidationSemantics' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NestedOneofToCheckValidationSemantics' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postPatternValidationRequestBody: + post: + operationId: postPatternValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatternValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/PatternValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postPatternIsNotAnchoredRequestBody: + post: + operationId: postPatternIsNotAnchoredRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatternIsNotAnchored' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/PatternIsNotAnchored' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postObjectPropertiesValidationRequestBody: + post: + operationId: postObjectPropertiesValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectPropertiesValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ObjectPropertiesValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postPropertiesWithEscapedCharactersRequestBody: + post: + operationId: postPropertiesWithEscapedCharactersRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PropertiesWithEscapedCharacters' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/PropertiesWithEscapedCharacters' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody: + post: + operationId: postPropertyNamedRefThatIsNotAReferenceRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyNamedRefThatIsNotAReference' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/PropertyNamedRefThatIsNotAReference' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInAdditionalpropertiesRequestBody: + post: + operationId: postRefInAdditionalpropertiesRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInAdditionalproperties' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInAdditionalproperties' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInItemsRequestBody: + post: + operationId: postRefInItemsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInItems' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInItems' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInPropertyRequestBody: + post: + operationId: postRefInPropertyRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInProperty' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInProperty' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInAllofRequestBody: + post: + operationId: postRefInAllofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInAllof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInAllof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInOneofRequestBody: + post: + operationId: postRefInOneofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInOneof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInOneof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRefInAnyofRequestBody: + post: + operationId: postRefInAnyofRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefInAnyof' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RefInAnyof' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRequiredValidationRequestBody: + post: + operationId: postRequiredValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RequiredValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRequiredDefaultValidationRequestBody: + post: + operationId: postRequiredDefaultValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredDefaultValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RequiredDefaultValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postRequiredWithEmptyArrayRequestBody: + post: + operationId: postRequiredWithEmptyArrayRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredWithEmptyArray' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/RequiredWithEmptyArray' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postIntegerTypeMatchesIntegersRequestBody: + post: + operationId: postIntegerTypeMatchesIntegersRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IntegerTypeMatchesIntegers' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/IntegerTypeMatchesIntegers' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNumberTypeMatchesNumbersRequestBody: + post: + operationId: postNumberTypeMatchesNumbersRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NumberTypeMatchesNumbers' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NumberTypeMatchesNumbers' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postStringTypeMatchesStringsRequestBody: + post: + operationId: postStringTypeMatchesStringsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StringTypeMatchesStrings' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/StringTypeMatchesStrings' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postObjectTypeMatchesObjectsRequestBody: + post: + operationId: postObjectTypeMatchesObjectsRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectTypeMatchesObjects' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ObjectTypeMatchesObjects' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postBooleanTypeMatchesBooleansRequestBody: + post: + operationId: postBooleanTypeMatchesBooleansRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BooleanTypeMatchesBooleans' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/BooleanTypeMatchesBooleans' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody: + post: + operationId: postNullTypeMatchesOnlyTheNullObjectRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NullTypeMatchesOnlyTheNullObject' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/NullTypeMatchesOnlyTheNullObject' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postArrayTypeMatchesArraysRequestBody: + post: + operationId: postArrayTypeMatchesArraysRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayTypeMatchesArrays' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/ArrayTypeMatchesArrays' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postUniqueitemsValidationRequestBody: + post: + operationId: postUniqueitemsValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UniqueitemsValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/UniqueitemsValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json + /requestBody/postUniqueitemsFalseValidationRequestBody: + post: + operationId: postUniqueitemsFalseValidationRequestBody + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UniqueitemsFalseValidation' + x-schema-test-examples: + $ref: '#/components/x-schema-test-examples/UniqueitemsFalseValidation' + required: true + responses: + '200': + description: success + tags: + - requestBody + - post + - json components: schemas: AdditionalpropertiesAllowsASchemaWhichShouldValidate: diff --git a/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/spec_writer.py b/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/spec_writer.py index c4843877a19..04a3fa5b339 100644 --- a/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/spec_writer.py +++ b/modules/openapi-generator/src/test/resources/3_0/unit_test_spec/spec_writer.py @@ -292,41 +292,93 @@ def get_json_schema_test_schemas(file_path: typing.Tuple[str]) -> typing.List[Js openapi_version = '3.0.3' - -@dataclasses.dataclass -class OpenApiDocumentInfo: - title: str - description: str - version: str - OpenApiSchema = typing.TypedDict( 'OpenApiSchema', { 'type': str, - 'x-test-examples': typing.Dict[str, JsonSchemaTestCase], 'items': 'OpenApiSchema', - 'properties': typing.Dict[str, 'OpenApiSchema'] - } + 'properties': typing.Dict[str, 'OpenApiSchema'], + '$ref': str + }, + total=False ) -@dataclasses.dataclass -class OpenApiExample: - description: str - value: typing.Union[str, int, float, bool, None, list, dict] +JsonSchemaTestCases = typing.Dict[str, JsonSchemaTestCase] OpenApiComponents = typing.TypedDict( 'OpenApiComponents', { - 'schemas': typing.Dict[str, typing.Union[bool, OpenApiSchema]], - 'x-schema-test-examples': typing.Dict[str, typing.Dict[str, JsonSchemaTestCase]] + 'schemas': typing.Dict[str, OpenApiSchema], + 'x-schema-test-examples': typing.Dict[str, JsonSchemaTestCases] } ) +OpenApiMediaType = typing.TypedDict( + 'OpenApiMediaType', + { + 'schema': OpenApiSchema, + 'x-schema-test-examples': JsonSchemaTestCases + }, + total=False +) + +class OpenApiRequestBody(typing.TypedDict, total=False): + description: str + content: typing.Dict[str, OpenApiMediaType] + required: bool + +class OpenApiResponseObject(typing.TypedDict): + description: str + headers: typing.Optional[typing.Dict[str, typing.Any]] = None + content: typing.Optional[typing.Dict[str, OpenApiMediaType]] = None + +class OpenApiOperation(typing.TypedDict, total=False): + tags: typing.List[str] + summary: str + description: str + operationId: str + requestBody: OpenApiRequestBody + responses: typing.Dict[str, OpenApiResponseObject] + +class OpenApiPathItem(typing.TypedDict, total=False): + summary: str + description: str + get: OpenApiOperation + put: OpenApiOperation + post: OpenApiOperation + delete: OpenApiOperation + options: OpenApiOperation + head: OpenApiOperation + patch: OpenApiOperation + trace: OpenApiOperation + +OpenApiPaths = typing.Dict[str, OpenApiPathItem] + + +@dataclasses.dataclass +class OpenApiDocumentInfo: + title: str + version: str + description: typing.Optional[str] = None + + +@dataclasses.dataclass +class OpenApiTag: + name: str + + +@dataclasses.dataclass +class OpenApiServer: + url: str + + @dataclasses.dataclass class OpenApiDocument: openapi: str + servers: typing.List[OpenApiServer] info: OpenApiDocumentInfo - paths: typing.Dict[str, typing.Any] + tags: typing.List[OpenApiTag] + paths: OpenApiPaths components: OpenApiComponents @@ -338,11 +390,13 @@ def get_new_openapi() -> OpenApiDocument: description=f"sample spec for testing openapi functionality, built from json schema tests for {json_schema_test_draft}", version="0.0.1" ), + servers=[OpenApiServer(url='https://someserver.com/v1')], + tags = [], paths={}, components=OpenApiComponents({ 'schemas': {}, 'x-schema-test-examples': {} - }) + }), ) def description_to_component_name(descr: str) -> str: @@ -353,7 +407,10 @@ def get_test_case_name(test: JsonSchemaTestSchema) -> str: res = ''.join(test.description.title().split()) return re.sub(r'[^A-Za-z0-9 ]+', '', res) -def get_component_schemas_and_test_examples(json_schema_test_file: str, folders: typing.Tuple[str]) -> typing.Dict[str, OpenApiSchema]: +def get_component_schemas_and_test_examples( + json_schema_test_file: str, + folders: typing.Tuple[str] +) -> typing.Tuple[typing.Dict[str, OpenApiSchema], typing.Dict[str, typing.Dict[str, JsonSchemaTestSchema]]]: component_schemas = {} component_name_to_test_examples = {} for folder in folders: @@ -374,8 +431,43 @@ def get_component_schemas_and_test_examples(json_schema_test_file: str, folders: component_name_to_test_examples[component_name][test_case_name] = test return component_schemas, component_name_to_test_examples +def generate_post_operation_with_request_body( + component_name: str, + tags: typing.List[OpenApiTag] +) -> OpenApiOperation: + method = 'post' + ref_schema_path = f'#/components/schemas/{component_name}' + ref_test_example_path = f'#/components/x-schema-test-examples/{component_name}' + media_type = OpenApiMediaType( + { + 'schema': OpenApiSchema({'$ref': ref_schema_path}), + 'x-schema-test-examples': {'$ref': ref_test_example_path} + } + ) + request_body = OpenApiRequestBody( + { + 'content': {'application/json': media_type}, + 'required': True + } + ) + operationId = f'{method}{component_name}RequestBody' + response_object = OpenApiResponseObject({'description': 'success'}) + return OpenApiOperation( + { + 'operationId': operationId, + 'requestBody': request_body, + 'responses': {'200': response_object}, + 'tags': [tag.name for tag in tags] + } + ) + def write_openapi_spec(): openapi = get_new_openapi() + request_body_tag = OpenApiTag(name='requestBody') + post_tag = OpenApiTag(name='post') + json_tag = OpenApiTag(name='json') + openapi.tags.append(request_body_tag) + # write component schemas and tests for json_schema_test_file, folders in JSON_SCHEMA_TEST_FILE_TO_FOLDERS.items(): component_schemas, component_name_to_test_examples = ( get_component_schemas_and_test_examples(json_schema_test_file, folders) @@ -388,6 +480,12 @@ def write_openapi_spec(): if component_name in openapi.components['x-schema-test-examples']: raise ValueError('A component schema test example map with that name is already defined!') openapi.components['x-schema-test-examples'][component_name] = test_examples + + operation = generate_post_operation_with_request_body(component_name, [request_body_tag, post_tag, json_tag]) + path_item = OpenApiPathItem(post=operation) + openapi.paths[f'/requestBody/{operation["operationId"]}'] = path_item + # todo add put and patch with paths requestBody/someIdentifier + print( yaml.dump( dataclasses.asdict(openapi), 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 e470d78a149..b01c4865bf1 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 @@ -38,6 +38,7 @@ docs/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md docs/InvalidStringValueForDefault.md docs/Ipv4Format.md docs/Ipv6Format.md +docs/JsonApi.md docs/JsonPointerFormat.md docs/MaximumValidation.md docs/MaximumValidationWithUnsignedInteger.md @@ -66,6 +67,7 @@ docs/OneofWithBaseSchema.md docs/OneofWithEmptySchema.md docs/PatternIsNotAnchored.md docs/PatternValidation.md +docs/PostApi.md docs/PropertiesWithEscapedCharacters.md docs/PropertyNamedRefThatIsNotAReference.md docs/RefInAdditionalproperties.md @@ -74,6 +76,7 @@ docs/RefInAnyof.md docs/RefInItems.md docs/RefInOneof.md docs/RefInProperty.md +docs/RequestBodyApi.md docs/RequiredDefaultValidation.md docs/RequiredValidation.md docs/RequiredWithEmptyArray.md @@ -127,6 +130,7 @@ test/test_invalid_instance_should_not_raise_error_when_float_division_inf.py test/test_invalid_string_value_for_default.py test/test_ipv4_format.py test/test_ipv6_format.py +test/test_json_api.py test/test_json_pointer_format.py test/test_maximum_validation.py test/test_maximum_validation_with_unsigned_integer.py @@ -155,6 +159,7 @@ test/test_oneof_with_base_schema.py test/test_oneof_with_empty_schema.py test/test_pattern_is_not_anchored.py test/test_pattern_validation.py +test/test_post_api.py test/test_properties_with_escaped_characters.py test/test_property_named_ref_that_is_not_a_reference.py test/test_ref_in_additionalproperties.py @@ -163,6 +168,7 @@ test/test_ref_in_anyof.py test/test_ref_in_items.py test/test_ref_in_oneof.py test/test_ref_in_property.py +test/test_request_body_api.py test/test_required_default_validation.py test/test_required_validation.py test/test_required_with_empty_array.py @@ -177,6 +183,9 @@ test/test_uri_template_format.py tox.ini unit_test_api/__init__.py unit_test_api/api/__init__.py +unit_test_api/api/json_api.py +unit_test_api/api/post_api.py +unit_test_api/api/request_body_api.py unit_test_api/api_client.py unit_test_api/apis/__init__.py unit_test_api/configuration.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md index 8f38f97e69e..c7aecb39d3d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md @@ -51,14 +51,354 @@ Please follow the [installation procedure](#installation--usage) and then run th import time import unit_test_api from pprint import pprint +from unit_test_api.api import json_api +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from unit_test_api.model.allof import Allof +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from unit_test_api.model.allof_simple_types import AllofSimpleTypes +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from unit_test_api.model.anyof import Anyof +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays +from unit_test_api.model.by_int import ByInt +from unit_test_api.model.by_number import ByNumber +from unit_test_api.model.by_small_number import BySmallNumber +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from unit_test_api.model.enums_in_properties import EnumsInProperties +from unit_test_api.model.forbidden_property import ForbiddenProperty +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault +from unit_test_api.model.maximum_validation import MaximumValidation +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from unit_test_api.model.maxitems_validation import MaxitemsValidation +from unit_test_api.model.maxlength_validation import MaxlengthValidation +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation +from unit_test_api.model.minimum_validation import MinimumValidation +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from unit_test_api.model.minitems_validation import MinitemsValidation +from unit_test_api.model.minlength_validation import MinlengthValidation +from unit_test_api.model.minproperties_validation import MinpropertiesValidation +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from unit_test_api.model.nested_items import NestedItems +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation +from unit_test_api.model.oneof import Oneof +from unit_test_api.model.oneof_complex_types import OneofComplexTypes +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored +from unit_test_api.model.pattern_validation import PatternValidation +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties +from unit_test_api.model.ref_in_allof import RefInAllof +from unit_test_api.model.ref_in_anyof import RefInAnyof +from unit_test_api.model.ref_in_items import RefInItems +from unit_test_api.model.ref_in_oneof import RefInOneof +from unit_test_api.model.ref_in_property import RefInProperty +from unit_test_api.model.required_default_validation import RequiredDefaultValidation +from unit_test_api.model.required_validation import RequiredValidation +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + additionalproperties_allows_a_schema_which_should_validate = AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) # AdditionalpropertiesAllowsASchemaWhichShouldValidate | + + try: + api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) ``` ## Documentation for API Endpoints -All URIs are relative to *http://localhost* +All URIs are relative to *https://someserver.com/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*JsonApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/JsonApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +*JsonApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/JsonApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +*JsonApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/JsonApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +*JsonApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/JsonApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +*JsonApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/JsonApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +*JsonApi* | [**post_allof_request_body**](docs/JsonApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +*JsonApi* | [**post_allof_simple_types_request_body**](docs/JsonApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +*JsonApi* | [**post_allof_with_base_schema_request_body**](docs/JsonApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +*JsonApi* | [**post_allof_with_one_empty_schema_request_body**](docs/JsonApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +*JsonApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/JsonApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +*JsonApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/JsonApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +*JsonApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/JsonApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +*JsonApi* | [**post_anyof_complex_types_request_body**](docs/JsonApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +*JsonApi* | [**post_anyof_request_body**](docs/JsonApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +*JsonApi* | [**post_anyof_with_base_schema_request_body**](docs/JsonApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +*JsonApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/JsonApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +*JsonApi* | [**post_array_type_matches_arrays_request_body**](docs/JsonApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +*JsonApi* | [**post_boolean_type_matches_booleans_request_body**](docs/JsonApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +*JsonApi* | [**post_by_int_request_body**](docs/JsonApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +*JsonApi* | [**post_by_number_request_body**](docs/JsonApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +*JsonApi* | [**post_by_small_number_request_body**](docs/JsonApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +*JsonApi* | [**post_date_time_format_request_body**](docs/JsonApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +*JsonApi* | [**post_email_format_request_body**](docs/JsonApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +*JsonApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/JsonApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +*JsonApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/JsonApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +*JsonApi* | [**post_enum_with_escaped_characters_request_body**](docs/JsonApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +*JsonApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/JsonApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +*JsonApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/JsonApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +*JsonApi* | [**post_enums_in_properties_request_body**](docs/JsonApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +*JsonApi* | [**post_forbidden_property_request_body**](docs/JsonApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +*JsonApi* | [**post_hostname_format_request_body**](docs/JsonApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +*JsonApi* | [**post_integer_type_matches_integers_request_body**](docs/JsonApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +*JsonApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/JsonApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +*JsonApi* | [**post_invalid_string_value_for_default_request_body**](docs/JsonApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +*JsonApi* | [**post_ipv4_format_request_body**](docs/JsonApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +*JsonApi* | [**post_ipv6_format_request_body**](docs/JsonApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +*JsonApi* | [**post_json_pointer_format_request_body**](docs/JsonApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +*JsonApi* | [**post_maximum_validation_request_body**](docs/JsonApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +*JsonApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/JsonApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +*JsonApi* | [**post_maxitems_validation_request_body**](docs/JsonApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +*JsonApi* | [**post_maxlength_validation_request_body**](docs/JsonApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +*JsonApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/JsonApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +*JsonApi* | [**post_maxproperties_validation_request_body**](docs/JsonApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +*JsonApi* | [**post_minimum_validation_request_body**](docs/JsonApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +*JsonApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/JsonApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +*JsonApi* | [**post_minitems_validation_request_body**](docs/JsonApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +*JsonApi* | [**post_minlength_validation_request_body**](docs/JsonApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +*JsonApi* | [**post_minproperties_validation_request_body**](docs/JsonApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +*JsonApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/JsonApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +*JsonApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/JsonApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +*JsonApi* | [**post_nested_items_request_body**](docs/JsonApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +*JsonApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/JsonApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +*JsonApi* | [**post_not_more_complex_schema_request_body**](docs/JsonApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +*JsonApi* | [**post_not_request_body**](docs/JsonApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +*JsonApi* | [**post_nul_characters_in_strings_request_body**](docs/JsonApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +*JsonApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/JsonApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +*JsonApi* | [**post_number_type_matches_numbers_request_body**](docs/JsonApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +*JsonApi* | [**post_object_properties_validation_request_body**](docs/JsonApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +*JsonApi* | [**post_object_type_matches_objects_request_body**](docs/JsonApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +*JsonApi* | [**post_oneof_complex_types_request_body**](docs/JsonApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +*JsonApi* | [**post_oneof_request_body**](docs/JsonApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +*JsonApi* | [**post_oneof_with_base_schema_request_body**](docs/JsonApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +*JsonApi* | [**post_oneof_with_empty_schema_request_body**](docs/JsonApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +*JsonApi* | [**post_pattern_is_not_anchored_request_body**](docs/JsonApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +*JsonApi* | [**post_pattern_validation_request_body**](docs/JsonApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +*JsonApi* | [**post_properties_with_escaped_characters_request_body**](docs/JsonApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +*JsonApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/JsonApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +*JsonApi* | [**post_ref_in_additionalproperties_request_body**](docs/JsonApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +*JsonApi* | [**post_ref_in_allof_request_body**](docs/JsonApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +*JsonApi* | [**post_ref_in_anyof_request_body**](docs/JsonApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +*JsonApi* | [**post_ref_in_items_request_body**](docs/JsonApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +*JsonApi* | [**post_ref_in_oneof_request_body**](docs/JsonApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +*JsonApi* | [**post_ref_in_property_request_body**](docs/JsonApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +*JsonApi* | [**post_required_default_validation_request_body**](docs/JsonApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +*JsonApi* | [**post_required_validation_request_body**](docs/JsonApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +*JsonApi* | [**post_required_with_empty_array_request_body**](docs/JsonApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +*JsonApi* | [**post_simple_enum_validation_request_body**](docs/JsonApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +*JsonApi* | [**post_string_type_matches_strings_request_body**](docs/JsonApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +*JsonApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/JsonApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +*JsonApi* | [**post_uniqueitems_false_validation_request_body**](docs/JsonApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +*JsonApi* | [**post_uniqueitems_validation_request_body**](docs/JsonApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +*JsonApi* | [**post_uri_format_request_body**](docs/JsonApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +*JsonApi* | [**post_uri_reference_format_request_body**](docs/JsonApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +*JsonApi* | [**post_uri_template_format_request_body**](docs/JsonApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | +*PostApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/PostApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +*PostApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/PostApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +*PostApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/PostApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +*PostApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/PostApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +*PostApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/PostApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +*PostApi* | [**post_allof_request_body**](docs/PostApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +*PostApi* | [**post_allof_simple_types_request_body**](docs/PostApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +*PostApi* | [**post_allof_with_base_schema_request_body**](docs/PostApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +*PostApi* | [**post_allof_with_one_empty_schema_request_body**](docs/PostApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +*PostApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/PostApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +*PostApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/PostApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +*PostApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/PostApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +*PostApi* | [**post_anyof_complex_types_request_body**](docs/PostApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +*PostApi* | [**post_anyof_request_body**](docs/PostApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +*PostApi* | [**post_anyof_with_base_schema_request_body**](docs/PostApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +*PostApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/PostApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +*PostApi* | [**post_array_type_matches_arrays_request_body**](docs/PostApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +*PostApi* | [**post_boolean_type_matches_booleans_request_body**](docs/PostApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +*PostApi* | [**post_by_int_request_body**](docs/PostApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +*PostApi* | [**post_by_number_request_body**](docs/PostApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +*PostApi* | [**post_by_small_number_request_body**](docs/PostApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +*PostApi* | [**post_date_time_format_request_body**](docs/PostApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +*PostApi* | [**post_email_format_request_body**](docs/PostApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +*PostApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/PostApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +*PostApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/PostApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +*PostApi* | [**post_enum_with_escaped_characters_request_body**](docs/PostApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +*PostApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/PostApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +*PostApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/PostApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +*PostApi* | [**post_enums_in_properties_request_body**](docs/PostApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +*PostApi* | [**post_forbidden_property_request_body**](docs/PostApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +*PostApi* | [**post_hostname_format_request_body**](docs/PostApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +*PostApi* | [**post_integer_type_matches_integers_request_body**](docs/PostApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +*PostApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/PostApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +*PostApi* | [**post_invalid_string_value_for_default_request_body**](docs/PostApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +*PostApi* | [**post_ipv4_format_request_body**](docs/PostApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +*PostApi* | [**post_ipv6_format_request_body**](docs/PostApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +*PostApi* | [**post_json_pointer_format_request_body**](docs/PostApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +*PostApi* | [**post_maximum_validation_request_body**](docs/PostApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +*PostApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/PostApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +*PostApi* | [**post_maxitems_validation_request_body**](docs/PostApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +*PostApi* | [**post_maxlength_validation_request_body**](docs/PostApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +*PostApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/PostApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +*PostApi* | [**post_maxproperties_validation_request_body**](docs/PostApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +*PostApi* | [**post_minimum_validation_request_body**](docs/PostApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +*PostApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/PostApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +*PostApi* | [**post_minitems_validation_request_body**](docs/PostApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +*PostApi* | [**post_minlength_validation_request_body**](docs/PostApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +*PostApi* | [**post_minproperties_validation_request_body**](docs/PostApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +*PostApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/PostApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +*PostApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/PostApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +*PostApi* | [**post_nested_items_request_body**](docs/PostApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +*PostApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/PostApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +*PostApi* | [**post_not_more_complex_schema_request_body**](docs/PostApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +*PostApi* | [**post_not_request_body**](docs/PostApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +*PostApi* | [**post_nul_characters_in_strings_request_body**](docs/PostApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +*PostApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/PostApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +*PostApi* | [**post_number_type_matches_numbers_request_body**](docs/PostApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +*PostApi* | [**post_object_properties_validation_request_body**](docs/PostApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +*PostApi* | [**post_object_type_matches_objects_request_body**](docs/PostApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +*PostApi* | [**post_oneof_complex_types_request_body**](docs/PostApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +*PostApi* | [**post_oneof_request_body**](docs/PostApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +*PostApi* | [**post_oneof_with_base_schema_request_body**](docs/PostApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +*PostApi* | [**post_oneof_with_empty_schema_request_body**](docs/PostApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +*PostApi* | [**post_pattern_is_not_anchored_request_body**](docs/PostApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +*PostApi* | [**post_pattern_validation_request_body**](docs/PostApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +*PostApi* | [**post_properties_with_escaped_characters_request_body**](docs/PostApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +*PostApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/PostApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +*PostApi* | [**post_ref_in_additionalproperties_request_body**](docs/PostApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +*PostApi* | [**post_ref_in_allof_request_body**](docs/PostApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +*PostApi* | [**post_ref_in_anyof_request_body**](docs/PostApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +*PostApi* | [**post_ref_in_items_request_body**](docs/PostApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +*PostApi* | [**post_ref_in_oneof_request_body**](docs/PostApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +*PostApi* | [**post_ref_in_property_request_body**](docs/PostApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +*PostApi* | [**post_required_default_validation_request_body**](docs/PostApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +*PostApi* | [**post_required_validation_request_body**](docs/PostApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +*PostApi* | [**post_required_with_empty_array_request_body**](docs/PostApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +*PostApi* | [**post_simple_enum_validation_request_body**](docs/PostApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +*PostApi* | [**post_string_type_matches_strings_request_body**](docs/PostApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +*PostApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/PostApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +*PostApi* | [**post_uniqueitems_false_validation_request_body**](docs/PostApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +*PostApi* | [**post_uniqueitems_validation_request_body**](docs/PostApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +*PostApi* | [**post_uri_format_request_body**](docs/PostApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +*PostApi* | [**post_uri_reference_format_request_body**](docs/PostApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +*PostApi* | [**post_uri_template_format_request_body**](docs/PostApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | +*RequestBodyApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/RequestBodyApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +*RequestBodyApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/RequestBodyApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +*RequestBodyApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/RequestBodyApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +*RequestBodyApi* | [**post_additionalproperties_should_not_look_in_applicators_request_body**](docs/RequestBodyApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +*RequestBodyApi* | [**post_allof_combined_with_anyof_oneof_request_body**](docs/RequestBodyApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +*RequestBodyApi* | [**post_allof_request_body**](docs/RequestBodyApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +*RequestBodyApi* | [**post_allof_simple_types_request_body**](docs/RequestBodyApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +*RequestBodyApi* | [**post_allof_with_base_schema_request_body**](docs/RequestBodyApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +*RequestBodyApi* | [**post_allof_with_one_empty_schema_request_body**](docs/RequestBodyApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +*RequestBodyApi* | [**post_allof_with_the_first_empty_schema_request_body**](docs/RequestBodyApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +*RequestBodyApi* | [**post_allof_with_the_last_empty_schema_request_body**](docs/RequestBodyApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +*RequestBodyApi* | [**post_allof_with_two_empty_schemas_request_body**](docs/RequestBodyApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +*RequestBodyApi* | [**post_anyof_complex_types_request_body**](docs/RequestBodyApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +*RequestBodyApi* | [**post_anyof_request_body**](docs/RequestBodyApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +*RequestBodyApi* | [**post_anyof_with_base_schema_request_body**](docs/RequestBodyApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +*RequestBodyApi* | [**post_anyof_with_one_empty_schema_request_body**](docs/RequestBodyApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +*RequestBodyApi* | [**post_array_type_matches_arrays_request_body**](docs/RequestBodyApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +*RequestBodyApi* | [**post_boolean_type_matches_booleans_request_body**](docs/RequestBodyApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +*RequestBodyApi* | [**post_by_int_request_body**](docs/RequestBodyApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +*RequestBodyApi* | [**post_by_number_request_body**](docs/RequestBodyApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +*RequestBodyApi* | [**post_by_small_number_request_body**](docs/RequestBodyApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +*RequestBodyApi* | [**post_date_time_format_request_body**](docs/RequestBodyApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +*RequestBodyApi* | [**post_email_format_request_body**](docs/RequestBodyApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +*RequestBodyApi* | [**post_enum_with0_does_not_match_false_request_body**](docs/RequestBodyApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +*RequestBodyApi* | [**post_enum_with1_does_not_match_true_request_body**](docs/RequestBodyApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +*RequestBodyApi* | [**post_enum_with_escaped_characters_request_body**](docs/RequestBodyApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +*RequestBodyApi* | [**post_enum_with_false_does_not_match0_request_body**](docs/RequestBodyApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +*RequestBodyApi* | [**post_enum_with_true_does_not_match1_request_body**](docs/RequestBodyApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +*RequestBodyApi* | [**post_enums_in_properties_request_body**](docs/RequestBodyApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +*RequestBodyApi* | [**post_forbidden_property_request_body**](docs/RequestBodyApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +*RequestBodyApi* | [**post_hostname_format_request_body**](docs/RequestBodyApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +*RequestBodyApi* | [**post_integer_type_matches_integers_request_body**](docs/RequestBodyApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +*RequestBodyApi* | [**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](docs/RequestBodyApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +*RequestBodyApi* | [**post_invalid_string_value_for_default_request_body**](docs/RequestBodyApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +*RequestBodyApi* | [**post_ipv4_format_request_body**](docs/RequestBodyApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +*RequestBodyApi* | [**post_ipv6_format_request_body**](docs/RequestBodyApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +*RequestBodyApi* | [**post_json_pointer_format_request_body**](docs/RequestBodyApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +*RequestBodyApi* | [**post_maximum_validation_request_body**](docs/RequestBodyApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +*RequestBodyApi* | [**post_maximum_validation_with_unsigned_integer_request_body**](docs/RequestBodyApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +*RequestBodyApi* | [**post_maxitems_validation_request_body**](docs/RequestBodyApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +*RequestBodyApi* | [**post_maxlength_validation_request_body**](docs/RequestBodyApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +*RequestBodyApi* | [**post_maxproperties0_means_the_object_is_empty_request_body**](docs/RequestBodyApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +*RequestBodyApi* | [**post_maxproperties_validation_request_body**](docs/RequestBodyApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +*RequestBodyApi* | [**post_minimum_validation_request_body**](docs/RequestBodyApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +*RequestBodyApi* | [**post_minimum_validation_with_signed_integer_request_body**](docs/RequestBodyApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +*RequestBodyApi* | [**post_minitems_validation_request_body**](docs/RequestBodyApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +*RequestBodyApi* | [**post_minlength_validation_request_body**](docs/RequestBodyApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +*RequestBodyApi* | [**post_minproperties_validation_request_body**](docs/RequestBodyApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +*RequestBodyApi* | [**post_nested_allof_to_check_validation_semantics_request_body**](docs/RequestBodyApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +*RequestBodyApi* | [**post_nested_anyof_to_check_validation_semantics_request_body**](docs/RequestBodyApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +*RequestBodyApi* | [**post_nested_items_request_body**](docs/RequestBodyApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +*RequestBodyApi* | [**post_nested_oneof_to_check_validation_semantics_request_body**](docs/RequestBodyApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +*RequestBodyApi* | [**post_not_more_complex_schema_request_body**](docs/RequestBodyApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +*RequestBodyApi* | [**post_not_request_body**](docs/RequestBodyApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +*RequestBodyApi* | [**post_nul_characters_in_strings_request_body**](docs/RequestBodyApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +*RequestBodyApi* | [**post_null_type_matches_only_the_null_object_request_body**](docs/RequestBodyApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +*RequestBodyApi* | [**post_number_type_matches_numbers_request_body**](docs/RequestBodyApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +*RequestBodyApi* | [**post_object_properties_validation_request_body**](docs/RequestBodyApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +*RequestBodyApi* | [**post_object_type_matches_objects_request_body**](docs/RequestBodyApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +*RequestBodyApi* | [**post_oneof_complex_types_request_body**](docs/RequestBodyApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +*RequestBodyApi* | [**post_oneof_request_body**](docs/RequestBodyApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +*RequestBodyApi* | [**post_oneof_with_base_schema_request_body**](docs/RequestBodyApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +*RequestBodyApi* | [**post_oneof_with_empty_schema_request_body**](docs/RequestBodyApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +*RequestBodyApi* | [**post_pattern_is_not_anchored_request_body**](docs/RequestBodyApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +*RequestBodyApi* | [**post_pattern_validation_request_body**](docs/RequestBodyApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +*RequestBodyApi* | [**post_properties_with_escaped_characters_request_body**](docs/RequestBodyApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +*RequestBodyApi* | [**post_property_named_ref_that_is_not_a_reference_request_body**](docs/RequestBodyApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +*RequestBodyApi* | [**post_ref_in_additionalproperties_request_body**](docs/RequestBodyApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +*RequestBodyApi* | [**post_ref_in_allof_request_body**](docs/RequestBodyApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +*RequestBodyApi* | [**post_ref_in_anyof_request_body**](docs/RequestBodyApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +*RequestBodyApi* | [**post_ref_in_items_request_body**](docs/RequestBodyApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +*RequestBodyApi* | [**post_ref_in_oneof_request_body**](docs/RequestBodyApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +*RequestBodyApi* | [**post_ref_in_property_request_body**](docs/RequestBodyApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +*RequestBodyApi* | [**post_required_default_validation_request_body**](docs/RequestBodyApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +*RequestBodyApi* | [**post_required_validation_request_body**](docs/RequestBodyApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +*RequestBodyApi* | [**post_required_with_empty_array_request_body**](docs/RequestBodyApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +*RequestBodyApi* | [**post_simple_enum_validation_request_body**](docs/RequestBodyApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +*RequestBodyApi* | [**post_string_type_matches_strings_request_body**](docs/RequestBodyApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +*RequestBodyApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/RequestBodyApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +*RequestBodyApi* | [**post_uniqueitems_false_validation_request_body**](docs/RequestBodyApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +*RequestBodyApi* | [**post_uniqueitems_validation_request_body**](docs/RequestBodyApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +*RequestBodyApi* | [**post_uri_format_request_body**](docs/RequestBodyApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +*RequestBodyApi* | [**post_uri_reference_format_request_body**](docs/RequestBodyApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +*RequestBodyApi* | [**post_uri_template_format_request_body**](docs/RequestBodyApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | ## Documentation For Models @@ -153,6 +493,9 @@ Class | Method | HTTP request | Description ## Author + + + ## Notes for Large OpenAPI documents If the OpenAPI document is large, imports in unit_test_api.apis and unit_test_api.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/JsonApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/JsonApi.md new file mode 100644 index 00000000000..1048f339a8a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/JsonApi.md @@ -0,0 +1,6243 @@ +# unit_test_api.JsonApi + +All URIs are relative to *https://someserver.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](JsonApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_are_allowed_by_default_request_body**](JsonApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_can_exist_by_itself_request_body**](JsonApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](JsonApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_allof_combined_with_anyof_oneof_request_body**](JsonApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_request_body**](JsonApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +[**post_allof_simple_types_request_body**](JsonApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_with_base_schema_request_body**](JsonApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_one_empty_schema_request_body**](JsonApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_request_body**](JsonApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_request_body**](JsonApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_two_empty_schemas_request_body**](JsonApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_anyof_complex_types_request_body**](JsonApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_request_body**](JsonApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +[**post_anyof_with_base_schema_request_body**](JsonApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_one_empty_schema_request_body**](JsonApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_array_type_matches_arrays_request_body**](JsonApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_boolean_type_matches_booleans_request_body**](JsonApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_by_int_request_body**](JsonApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +[**post_by_number_request_body**](JsonApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +[**post_by_small_number_request_body**](JsonApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +[**post_date_time_format_request_body**](JsonApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +[**post_email_format_request_body**](JsonApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +[**post_enum_with0_does_not_match_false_request_body**](JsonApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with1_does_not_match_true_request_body**](JsonApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with_escaped_characters_request_body**](JsonApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_false_does_not_match0_request_body**](JsonApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_true_does_not_match1_request_body**](JsonApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enums_in_properties_request_body**](JsonApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +[**post_forbidden_property_request_body**](JsonApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +[**post_hostname_format_request_body**](JsonApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +[**post_integer_type_matches_integers_request_body**](JsonApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](JsonApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_string_value_for_default_request_body**](JsonApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_ipv4_format_request_body**](JsonApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +[**post_ipv6_format_request_body**](JsonApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +[**post_json_pointer_format_request_body**](JsonApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +[**post_maximum_validation_request_body**](JsonApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_with_unsigned_integer_request_body**](JsonApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maxitems_validation_request_body**](JsonApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxlength_validation_request_body**](JsonApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxproperties0_means_the_object_is_empty_request_body**](JsonApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties_validation_request_body**](JsonApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_minimum_validation_request_body**](JsonApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_with_signed_integer_request_body**](JsonApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minitems_validation_request_body**](JsonApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +[**post_minlength_validation_request_body**](JsonApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +[**post_minproperties_validation_request_body**](JsonApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +[**post_nested_allof_to_check_validation_semantics_request_body**](JsonApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_request_body**](JsonApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_items_request_body**](JsonApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_request_body**](JsonApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_not_more_complex_schema_request_body**](JsonApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_request_body**](JsonApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +[**post_nul_characters_in_strings_request_body**](JsonApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +[**post_null_type_matches_only_the_null_object_request_body**](JsonApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_number_type_matches_numbers_request_body**](JsonApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_object_properties_validation_request_body**](JsonApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_type_matches_objects_request_body**](JsonApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_oneof_complex_types_request_body**](JsonApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_request_body**](JsonApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +[**post_oneof_with_base_schema_request_body**](JsonApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_empty_schema_request_body**](JsonApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_pattern_is_not_anchored_request_body**](JsonApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_validation_request_body**](JsonApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +[**post_properties_with_escaped_characters_request_body**](JsonApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_property_named_ref_that_is_not_a_reference_request_body**](JsonApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_ref_in_additionalproperties_request_body**](JsonApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_allof_request_body**](JsonApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_anyof_request_body**](JsonApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_items_request_body**](JsonApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_oneof_request_body**](JsonApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_property_request_body**](JsonApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +[**post_required_default_validation_request_body**](JsonApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_validation_request_body**](JsonApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +[**post_required_with_empty_array_request_body**](JsonApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_simple_enum_validation_request_body**](JsonApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +[**post_string_type_matches_strings_request_body**](JsonApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](JsonApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_uniqueitems_false_validation_request_body**](JsonApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_validation_request_body**](JsonApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uri_format_request_body**](JsonApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +[**post_uri_reference_format_request_body**](JsonApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_template_format_request_body**](JsonApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | + +# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** +> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) + try: + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_are_allowed_by_default_request_body** +> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAreAllowedByDefault(None) + try: + api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAreAllowedByDefault**](AdditionalpropertiesAreAllowedByDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_can_exist_by_itself_request_body** +> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesCanExistByItself( + key=True, + ) + try: + api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesCanExistByItself**](AdditionalpropertiesCanExistByItself.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_should_not_look_in_applicators_request_body** +> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesShouldNotLookInApplicators(None) + try: + api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesShouldNotLookInApplicators**](AdditionalpropertiesShouldNotLookInApplicators.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_combined_with_anyof_oneof_request_body** +> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofCombinedWithAnyofOneof(None) + try: + api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofCombinedWithAnyofOneof**](AllofCombinedWithAnyofOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_request_body** +> post_allof_request_body(allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof import Allof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = Allof(None) + try: + api_response = api_instance.post_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Allof**](Allof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_simple_types_request_body** +> post_allof_simple_types_request_body(allof_simple_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_simple_types import AllofSimpleTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofSimpleTypes(None) + try: + api_response = api_instance.post_allof_simple_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_simple_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofSimpleTypes**](AllofSimpleTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_base_schema_request_body** +> post_allof_with_base_schema_request_body(allof_with_base_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithBaseSchema({}) + try: + api_response = api_instance.post_allof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithBaseSchema**](AllofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_one_empty_schema_request_body** +> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithOneEmptySchema(None) + try: + api_response = api_instance.post_allof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithOneEmptySchema**](AllofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_first_empty_schema_request_body** +> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheFirstEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheFirstEmptySchema**](AllofWithTheFirstEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_last_empty_schema_request_body** +> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheLastEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheLastEmptySchema**](AllofWithTheLastEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_two_empty_schemas_request_body** +> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTwoEmptySchemas(None) + try: + api_response = api_instance.post_allof_with_two_empty_schemas_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTwoEmptySchemas**](AllofWithTwoEmptySchemas.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_complex_types_request_body** +> post_anyof_complex_types_request_body(anyof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofComplexTypes(None) + try: + api_response = api_instance.post_anyof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_anyof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofComplexTypes**](AnyofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_request_body** +> post_anyof_request_body(anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.anyof import Anyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = Anyof(None) + try: + api_response = api_instance.post_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Anyof**](Anyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_base_schema_request_body** +> post_anyof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithBaseSchema("body_example") + try: + api_response = api_instance.post_anyof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_anyof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithBaseSchema**](AnyofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_one_empty_schema_request_body** +> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithOneEmptySchema(None) + try: + api_response = api_instance.post_anyof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithOneEmptySchema**](AnyofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_array_type_matches_arrays_request_body** +> post_array_type_matches_arrays_request_body(array_type_matches_arrays) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = ArrayTypeMatchesArrays([ + None + ]) + try: + api_response = api_instance.post_array_type_matches_arrays_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_array_type_matches_arrays_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ArrayTypeMatchesArrays**](ArrayTypeMatchesArrays.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boolean_type_matches_booleans_request_body** +> post_boolean_type_matches_booleans_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = True + try: + api_response = api_instance.post_boolean_type_matches_booleans_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_int_request_body** +> post_by_int_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.by_int import ByInt +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = ByInt(None) + try: + api_response = api_instance.post_by_int_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_by_int_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByInt**](ByInt.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_number_request_body** +> post_by_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.by_number import ByNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = ByNumber(None) + try: + api_response = api_instance.post_by_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_by_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByNumber**](ByNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_small_number_request_body** +> post_by_small_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.by_small_number import BySmallNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = BySmallNumber(None) + try: + api_response = api_instance.post_by_small_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_by_small_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**BySmallNumber**](BySmallNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_date_time_format_request_body** +> post_date_time_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_date_time_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_date_time_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_email_format_request_body** +> post_email_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_email_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_email_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with0_does_not_match_false_request_body** +> post_enum_with0_does_not_match_false_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith0DoesNotMatchFalse(0) + try: + api_response = api_instance.post_enum_with0_does_not_match_false_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith0DoesNotMatchFalse**](EnumWith0DoesNotMatchFalse.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with1_does_not_match_true_request_body** +> post_enum_with1_does_not_match_true_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith1DoesNotMatchTrue(1) + try: + api_response = api_instance.post_enum_with1_does_not_match_true_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith1DoesNotMatchTrue**](EnumWith1DoesNotMatchTrue.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_escaped_characters_request_body** +> post_enum_with_escaped_characters_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithEscapedCharacters("foo +bar") + try: + api_response = api_instance.post_enum_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enum_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithEscapedCharacters**](EnumWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_false_does_not_match0_request_body** +> post_enum_with_false_does_not_match0_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithFalseDoesNotMatch0(False) + try: + api_response = api_instance.post_enum_with_false_does_not_match0_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithFalseDoesNotMatch0**](EnumWithFalseDoesNotMatch0.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_true_does_not_match1_request_body** +> post_enum_with_true_does_not_match1_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithTrueDoesNotMatch1(True) + try: + api_response = api_instance.post_enum_with_true_does_not_match1_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithTrueDoesNotMatch1**](EnumWithTrueDoesNotMatch1.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enums_in_properties_request_body** +> post_enums_in_properties_request_body(enums_in_properties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.enums_in_properties import EnumsInProperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumsInProperties( + foo="foo", + bar="bar", + ) + try: + api_response = api_instance.post_enums_in_properties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_enums_in_properties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumsInProperties**](EnumsInProperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_forbidden_property_request_body** +> post_forbidden_property_request_body(forbidden_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.forbidden_property import ForbiddenProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = ForbiddenProperty(None) + try: + api_response = api_instance.post_forbidden_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_forbidden_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ForbiddenProperty**](ForbiddenProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_hostname_format_request_body** +> post_hostname_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_hostname_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_hostname_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_integer_type_matches_integers_request_body** +> post_integer_type_matches_integers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = 1 + try: + api_response = api_instance.post_integer_type_matches_integers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_integer_type_matches_integers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** +> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) + try: + api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_string_value_for_default_request_body** +> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidStringValueForDefault(None) + try: + api_response = api_instance.post_invalid_string_value_for_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_invalid_string_value_for_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidStringValueForDefault**](InvalidStringValueForDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv4_format_request_body** +> post_ipv4_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv4_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ipv4_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv6_format_request_body** +> post_ipv6_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv6_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ipv6_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_json_pointer_format_request_body** +> post_json_pointer_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_json_pointer_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_json_pointer_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_request_body** +> post_maximum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maximum_validation import MaximumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidation(None) + try: + api_response = api_instance.post_maximum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maximum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidation**](MaximumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_with_unsigned_integer_request_body** +> post_maximum_validation_with_unsigned_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidationWithUnsignedInteger(None) + try: + api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidationWithUnsignedInteger**](MaximumValidationWithUnsignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxitems_validation_request_body** +> post_maxitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maxitems_validation import MaxitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxitemsValidation(None) + try: + api_response = api_instance.post_maxitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maxitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxitemsValidation**](MaxitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxlength_validation_request_body** +> post_maxlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maxlength_validation import MaxlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxlengthValidation(None) + try: + api_response = api_instance.post_maxlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maxlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxlengthValidation**](MaxlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties0_means_the_object_is_empty_request_body** +> post_maxproperties0_means_the_object_is_empty_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = Maxproperties0MeansTheObjectIsEmpty(None) + try: + api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Maxproperties0MeansTheObjectIsEmpty**](Maxproperties0MeansTheObjectIsEmpty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties_validation_request_body** +> post_maxproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxpropertiesValidation(None) + try: + api_response = api_instance.post_maxproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_maxproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxpropertiesValidation**](MaxpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_request_body** +> post_minimum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.minimum_validation import MinimumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidation(None) + try: + api_response = api_instance.post_minimum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_minimum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidation**](MinimumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_with_signed_integer_request_body** +> post_minimum_validation_with_signed_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidationWithSignedInteger(None) + try: + api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidationWithSignedInteger**](MinimumValidationWithSignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minitems_validation_request_body** +> post_minitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.minitems_validation import MinitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MinitemsValidation(None) + try: + api_response = api_instance.post_minitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_minitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinitemsValidation**](MinitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minlength_validation_request_body** +> post_minlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.minlength_validation import MinlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MinlengthValidation(None) + try: + api_response = api_instance.post_minlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_minlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinlengthValidation**](MinlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minproperties_validation_request_body** +> post_minproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.minproperties_validation import MinpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = MinpropertiesValidation(None) + try: + api_response = api_instance.post_minproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_minproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinpropertiesValidation**](MinpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_allof_to_check_validation_semantics_request_body** +> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAllofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAllofToCheckValidationSemantics**](NestedAllofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_anyof_to_check_validation_semantics_request_body** +> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAnyofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAnyofToCheckValidationSemantics**](NestedAnyofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_items_request_body** +> post_nested_items_request_body(nested_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.nested_items import NestedItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedItems([ + [ + [ + [ + 3.14 + ] + ] + ] + ]) + try: + api_response = api_instance.post_nested_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_nested_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedItems**](NestedItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_oneof_to_check_validation_semantics_request_body** +> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedOneofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedOneofToCheckValidationSemantics**](NestedOneofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_more_complex_schema_request_body** +> post_not_more_complex_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_more_complex_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_not_more_complex_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_request_body** +> post_not_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_not_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nul_characters_in_strings_request_body** +> post_nul_characters_in_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = NulCharactersInStrings("hellothere") + try: + api_response = api_instance.post_nul_characters_in_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_nul_characters_in_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NulCharactersInStrings**](NulCharactersInStrings.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_null_type_matches_only_the_null_object_request_body** +> post_null_type_matches_only_the_null_object_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**none_type** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_number_type_matches_numbers_request_body** +> post_number_type_matches_numbers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = 3.14 + try: + api_response = api_instance.post_number_type_matches_numbers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_number_type_matches_numbers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int, float** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_properties_validation_request_body** +> post_object_properties_validation_request_body(object_properties_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = ObjectPropertiesValidation(None) + try: + api_response = api_instance.post_object_properties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_object_properties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ObjectPropertiesValidation**](ObjectPropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_type_matches_objects_request_body** +> post_object_type_matches_objects_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = dict() + try: + api_response = api_instance.post_object_type_matches_objects_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_object_type_matches_objects_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_complex_types_request_body** +> post_oneof_complex_types_request_body(oneof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.oneof_complex_types import OneofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofComplexTypes(None) + try: + api_response = api_instance.post_oneof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_oneof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofComplexTypes**](OneofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_request_body** +> post_oneof_request_body(oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.oneof import Oneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = Oneof(None) + try: + api_response = api_instance.post_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Oneof**](Oneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_base_schema_request_body** +> post_oneof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithBaseSchema("body_example") + try: + api_response = api_instance.post_oneof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_oneof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithBaseSchema**](OneofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_empty_schema_request_body** +> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithEmptySchema(None) + try: + api_response = api_instance.post_oneof_with_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_oneof_with_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithEmptySchema**](OneofWithEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_is_not_anchored_request_body** +> post_pattern_is_not_anchored_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternIsNotAnchored(None) + try: + api_response = api_instance.post_pattern_is_not_anchored_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_pattern_is_not_anchored_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternIsNotAnchored**](PatternIsNotAnchored.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_validation_request_body** +> post_pattern_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.pattern_validation import PatternValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternValidation(None) + try: + api_response = api_instance.post_pattern_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_pattern_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternValidation**](PatternValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_properties_with_escaped_characters_request_body** +> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertiesWithEscapedCharacters(None) + try: + api_response = api_instance.post_properties_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_properties_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertiesWithEscapedCharacters**](PropertiesWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_property_named_ref_that_is_not_a_reference_request_body** +> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertyNamedRefThatIsNotAReference(None) + try: + api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_additionalproperties_request_body** +> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAdditionalproperties( + key=PropertyNamedRefThatIsNotAReference(None), + ) + try: + api_response = api_instance.post_ref_in_additionalproperties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_additionalproperties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAdditionalproperties**](RefInAdditionalproperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_allof_request_body** +> post_ref_in_allof_request_body(ref_in_allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_allof import RefInAllof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAllof(None) + try: + api_response = api_instance.post_ref_in_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAllof**](RefInAllof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_anyof_request_body** +> post_ref_in_anyof_request_body(ref_in_anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_anyof import RefInAnyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAnyof(None) + try: + api_response = api_instance.post_ref_in_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAnyof**](RefInAnyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_items_request_body** +> post_ref_in_items_request_body(ref_in_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_items import RefInItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInItems([ + PropertyNamedRefThatIsNotAReference(None) + ]) + try: + api_response = api_instance.post_ref_in_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInItems**](RefInItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_oneof_request_body** +> post_ref_in_oneof_request_body(ref_in_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_oneof import RefInOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInOneof(None) + try: + api_response = api_instance.post_ref_in_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInOneof**](RefInOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_property_request_body** +> post_ref_in_property_request_body(ref_in_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.ref_in_property import RefInProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInProperty(None) + try: + api_response = api_instance.post_ref_in_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_ref_in_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInProperty**](RefInProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_default_validation_request_body** +> post_required_default_validation_request_body(required_default_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.required_default_validation import RequiredDefaultValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredDefaultValidation(None) + try: + api_response = api_instance.post_required_default_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_required_default_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredDefaultValidation**](RequiredDefaultValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_validation_request_body** +> post_required_validation_request_body(required_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.required_validation import RequiredValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredValidation(None) + try: + api_response = api_instance.post_required_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_required_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredValidation**](RequiredValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_with_empty_array_request_body** +> post_required_with_empty_array_request_body(required_with_empty_array) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredWithEmptyArray(None) + try: + api_response = api_instance.post_required_with_empty_array_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_required_with_empty_array_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredWithEmptyArray**](RequiredWithEmptyArray.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_simple_enum_validation_request_body** +> post_simple_enum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = SimpleEnumValidation(1) + try: + api_response = api_instance.post_simple_enum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_simple_enum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**SimpleEnumValidation**](SimpleEnumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_string_type_matches_strings_request_body** +> post_string_type_matches_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = "body_example" + try: + api_response = api_instance.post_string_type_matches_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_string_type_matches_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** +> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + alpha=5, + ) + try: + api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_false_validation_request_body** +> post_uniqueitems_false_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsFalseValidation(None) + try: + api_response = api_instance.post_uniqueitems_false_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_uniqueitems_false_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsFalseValidation**](UniqueitemsFalseValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_validation_request_body** +> post_uniqueitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsValidation(None) + try: + api_response = api_instance.post_uniqueitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_uniqueitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsValidation**](UniqueitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_format_request_body** +> post_uri_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_uri_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_reference_format_request_body** +> post_uri_reference_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_reference_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_uri_reference_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_template_format_request_body** +> post_uri_template_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import json_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = json_api.JsonApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_template_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling JsonApi->post_uri_template_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/PostApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/PostApi.md new file mode 100644 index 00000000000..cfb3dc18ae4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/PostApi.md @@ -0,0 +1,6243 @@ +# unit_test_api.PostApi + +All URIs are relative to *https://someserver.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](PostApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_are_allowed_by_default_request_body**](PostApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_can_exist_by_itself_request_body**](PostApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](PostApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_allof_combined_with_anyof_oneof_request_body**](PostApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_request_body**](PostApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +[**post_allof_simple_types_request_body**](PostApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_with_base_schema_request_body**](PostApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_one_empty_schema_request_body**](PostApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_request_body**](PostApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_request_body**](PostApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_two_empty_schemas_request_body**](PostApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_anyof_complex_types_request_body**](PostApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_request_body**](PostApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +[**post_anyof_with_base_schema_request_body**](PostApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_one_empty_schema_request_body**](PostApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_array_type_matches_arrays_request_body**](PostApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_boolean_type_matches_booleans_request_body**](PostApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_by_int_request_body**](PostApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +[**post_by_number_request_body**](PostApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +[**post_by_small_number_request_body**](PostApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +[**post_date_time_format_request_body**](PostApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +[**post_email_format_request_body**](PostApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +[**post_enum_with0_does_not_match_false_request_body**](PostApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with1_does_not_match_true_request_body**](PostApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with_escaped_characters_request_body**](PostApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_false_does_not_match0_request_body**](PostApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_true_does_not_match1_request_body**](PostApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enums_in_properties_request_body**](PostApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +[**post_forbidden_property_request_body**](PostApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +[**post_hostname_format_request_body**](PostApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +[**post_integer_type_matches_integers_request_body**](PostApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](PostApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_string_value_for_default_request_body**](PostApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_ipv4_format_request_body**](PostApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +[**post_ipv6_format_request_body**](PostApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +[**post_json_pointer_format_request_body**](PostApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +[**post_maximum_validation_request_body**](PostApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_with_unsigned_integer_request_body**](PostApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maxitems_validation_request_body**](PostApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxlength_validation_request_body**](PostApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxproperties0_means_the_object_is_empty_request_body**](PostApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties_validation_request_body**](PostApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_minimum_validation_request_body**](PostApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_with_signed_integer_request_body**](PostApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minitems_validation_request_body**](PostApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +[**post_minlength_validation_request_body**](PostApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +[**post_minproperties_validation_request_body**](PostApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +[**post_nested_allof_to_check_validation_semantics_request_body**](PostApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_request_body**](PostApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_items_request_body**](PostApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_request_body**](PostApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_not_more_complex_schema_request_body**](PostApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_request_body**](PostApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +[**post_nul_characters_in_strings_request_body**](PostApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +[**post_null_type_matches_only_the_null_object_request_body**](PostApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_number_type_matches_numbers_request_body**](PostApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_object_properties_validation_request_body**](PostApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_type_matches_objects_request_body**](PostApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_oneof_complex_types_request_body**](PostApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_request_body**](PostApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +[**post_oneof_with_base_schema_request_body**](PostApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_empty_schema_request_body**](PostApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_pattern_is_not_anchored_request_body**](PostApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_validation_request_body**](PostApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +[**post_properties_with_escaped_characters_request_body**](PostApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_property_named_ref_that_is_not_a_reference_request_body**](PostApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_ref_in_additionalproperties_request_body**](PostApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_allof_request_body**](PostApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_anyof_request_body**](PostApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_items_request_body**](PostApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_oneof_request_body**](PostApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_property_request_body**](PostApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +[**post_required_default_validation_request_body**](PostApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_validation_request_body**](PostApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +[**post_required_with_empty_array_request_body**](PostApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_simple_enum_validation_request_body**](PostApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +[**post_string_type_matches_strings_request_body**](PostApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](PostApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_uniqueitems_false_validation_request_body**](PostApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_validation_request_body**](PostApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uri_format_request_body**](PostApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +[**post_uri_reference_format_request_body**](PostApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_template_format_request_body**](PostApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | + +# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** +> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) + try: + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_are_allowed_by_default_request_body** +> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAreAllowedByDefault(None) + try: + api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAreAllowedByDefault**](AdditionalpropertiesAreAllowedByDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_can_exist_by_itself_request_body** +> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesCanExistByItself( + key=True, + ) + try: + api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesCanExistByItself**](AdditionalpropertiesCanExistByItself.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_should_not_look_in_applicators_request_body** +> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesShouldNotLookInApplicators(None) + try: + api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesShouldNotLookInApplicators**](AdditionalpropertiesShouldNotLookInApplicators.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_combined_with_anyof_oneof_request_body** +> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofCombinedWithAnyofOneof(None) + try: + api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofCombinedWithAnyofOneof**](AllofCombinedWithAnyofOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_request_body** +> post_allof_request_body(allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof import Allof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = Allof(None) + try: + api_response = api_instance.post_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Allof**](Allof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_simple_types_request_body** +> post_allof_simple_types_request_body(allof_simple_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_simple_types import AllofSimpleTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofSimpleTypes(None) + try: + api_response = api_instance.post_allof_simple_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_simple_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofSimpleTypes**](AllofSimpleTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_base_schema_request_body** +> post_allof_with_base_schema_request_body(allof_with_base_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithBaseSchema({}) + try: + api_response = api_instance.post_allof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithBaseSchema**](AllofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_one_empty_schema_request_body** +> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithOneEmptySchema(None) + try: + api_response = api_instance.post_allof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithOneEmptySchema**](AllofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_first_empty_schema_request_body** +> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheFirstEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheFirstEmptySchema**](AllofWithTheFirstEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_last_empty_schema_request_body** +> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheLastEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheLastEmptySchema**](AllofWithTheLastEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_two_empty_schemas_request_body** +> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTwoEmptySchemas(None) + try: + api_response = api_instance.post_allof_with_two_empty_schemas_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTwoEmptySchemas**](AllofWithTwoEmptySchemas.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_complex_types_request_body** +> post_anyof_complex_types_request_body(anyof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofComplexTypes(None) + try: + api_response = api_instance.post_anyof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_anyof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofComplexTypes**](AnyofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_request_body** +> post_anyof_request_body(anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.anyof import Anyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = Anyof(None) + try: + api_response = api_instance.post_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Anyof**](Anyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_base_schema_request_body** +> post_anyof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithBaseSchema("body_example") + try: + api_response = api_instance.post_anyof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_anyof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithBaseSchema**](AnyofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_one_empty_schema_request_body** +> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithOneEmptySchema(None) + try: + api_response = api_instance.post_anyof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithOneEmptySchema**](AnyofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_array_type_matches_arrays_request_body** +> post_array_type_matches_arrays_request_body(array_type_matches_arrays) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = ArrayTypeMatchesArrays([ + None + ]) + try: + api_response = api_instance.post_array_type_matches_arrays_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_array_type_matches_arrays_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ArrayTypeMatchesArrays**](ArrayTypeMatchesArrays.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boolean_type_matches_booleans_request_body** +> post_boolean_type_matches_booleans_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = True + try: + api_response = api_instance.post_boolean_type_matches_booleans_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_int_request_body** +> post_by_int_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.by_int import ByInt +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = ByInt(None) + try: + api_response = api_instance.post_by_int_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_by_int_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByInt**](ByInt.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_number_request_body** +> post_by_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.by_number import ByNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = ByNumber(None) + try: + api_response = api_instance.post_by_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_by_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByNumber**](ByNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_small_number_request_body** +> post_by_small_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.by_small_number import BySmallNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = BySmallNumber(None) + try: + api_response = api_instance.post_by_small_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_by_small_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**BySmallNumber**](BySmallNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_date_time_format_request_body** +> post_date_time_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_date_time_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_date_time_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_email_format_request_body** +> post_email_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_email_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_email_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with0_does_not_match_false_request_body** +> post_enum_with0_does_not_match_false_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith0DoesNotMatchFalse(0) + try: + api_response = api_instance.post_enum_with0_does_not_match_false_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith0DoesNotMatchFalse**](EnumWith0DoesNotMatchFalse.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with1_does_not_match_true_request_body** +> post_enum_with1_does_not_match_true_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith1DoesNotMatchTrue(1) + try: + api_response = api_instance.post_enum_with1_does_not_match_true_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith1DoesNotMatchTrue**](EnumWith1DoesNotMatchTrue.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_escaped_characters_request_body** +> post_enum_with_escaped_characters_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithEscapedCharacters("foo +bar") + try: + api_response = api_instance.post_enum_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enum_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithEscapedCharacters**](EnumWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_false_does_not_match0_request_body** +> post_enum_with_false_does_not_match0_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithFalseDoesNotMatch0(False) + try: + api_response = api_instance.post_enum_with_false_does_not_match0_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithFalseDoesNotMatch0**](EnumWithFalseDoesNotMatch0.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_true_does_not_match1_request_body** +> post_enum_with_true_does_not_match1_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithTrueDoesNotMatch1(True) + try: + api_response = api_instance.post_enum_with_true_does_not_match1_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithTrueDoesNotMatch1**](EnumWithTrueDoesNotMatch1.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enums_in_properties_request_body** +> post_enums_in_properties_request_body(enums_in_properties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.enums_in_properties import EnumsInProperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumsInProperties( + foo="foo", + bar="bar", + ) + try: + api_response = api_instance.post_enums_in_properties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_enums_in_properties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumsInProperties**](EnumsInProperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_forbidden_property_request_body** +> post_forbidden_property_request_body(forbidden_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.forbidden_property import ForbiddenProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = ForbiddenProperty(None) + try: + api_response = api_instance.post_forbidden_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_forbidden_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ForbiddenProperty**](ForbiddenProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_hostname_format_request_body** +> post_hostname_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_hostname_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_hostname_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_integer_type_matches_integers_request_body** +> post_integer_type_matches_integers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = 1 + try: + api_response = api_instance.post_integer_type_matches_integers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_integer_type_matches_integers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** +> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) + try: + api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_string_value_for_default_request_body** +> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidStringValueForDefault(None) + try: + api_response = api_instance.post_invalid_string_value_for_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_invalid_string_value_for_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidStringValueForDefault**](InvalidStringValueForDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv4_format_request_body** +> post_ipv4_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv4_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ipv4_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv6_format_request_body** +> post_ipv6_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv6_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ipv6_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_json_pointer_format_request_body** +> post_json_pointer_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_json_pointer_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_json_pointer_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_request_body** +> post_maximum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maximum_validation import MaximumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidation(None) + try: + api_response = api_instance.post_maximum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maximum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidation**](MaximumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_with_unsigned_integer_request_body** +> post_maximum_validation_with_unsigned_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidationWithUnsignedInteger(None) + try: + api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidationWithUnsignedInteger**](MaximumValidationWithUnsignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxitems_validation_request_body** +> post_maxitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maxitems_validation import MaxitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxitemsValidation(None) + try: + api_response = api_instance.post_maxitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maxitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxitemsValidation**](MaxitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxlength_validation_request_body** +> post_maxlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maxlength_validation import MaxlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxlengthValidation(None) + try: + api_response = api_instance.post_maxlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maxlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxlengthValidation**](MaxlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties0_means_the_object_is_empty_request_body** +> post_maxproperties0_means_the_object_is_empty_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = Maxproperties0MeansTheObjectIsEmpty(None) + try: + api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Maxproperties0MeansTheObjectIsEmpty**](Maxproperties0MeansTheObjectIsEmpty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties_validation_request_body** +> post_maxproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxpropertiesValidation(None) + try: + api_response = api_instance.post_maxproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_maxproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxpropertiesValidation**](MaxpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_request_body** +> post_minimum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.minimum_validation import MinimumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidation(None) + try: + api_response = api_instance.post_minimum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_minimum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidation**](MinimumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_with_signed_integer_request_body** +> post_minimum_validation_with_signed_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidationWithSignedInteger(None) + try: + api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidationWithSignedInteger**](MinimumValidationWithSignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minitems_validation_request_body** +> post_minitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.minitems_validation import MinitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MinitemsValidation(None) + try: + api_response = api_instance.post_minitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_minitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinitemsValidation**](MinitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minlength_validation_request_body** +> post_minlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.minlength_validation import MinlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MinlengthValidation(None) + try: + api_response = api_instance.post_minlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_minlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinlengthValidation**](MinlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minproperties_validation_request_body** +> post_minproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.minproperties_validation import MinpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = MinpropertiesValidation(None) + try: + api_response = api_instance.post_minproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_minproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinpropertiesValidation**](MinpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_allof_to_check_validation_semantics_request_body** +> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAllofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAllofToCheckValidationSemantics**](NestedAllofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_anyof_to_check_validation_semantics_request_body** +> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAnyofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAnyofToCheckValidationSemantics**](NestedAnyofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_items_request_body** +> post_nested_items_request_body(nested_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.nested_items import NestedItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedItems([ + [ + [ + [ + 3.14 + ] + ] + ] + ]) + try: + api_response = api_instance.post_nested_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_nested_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedItems**](NestedItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_oneof_to_check_validation_semantics_request_body** +> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedOneofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedOneofToCheckValidationSemantics**](NestedOneofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_more_complex_schema_request_body** +> post_not_more_complex_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_more_complex_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_not_more_complex_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_request_body** +> post_not_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_not_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nul_characters_in_strings_request_body** +> post_nul_characters_in_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = NulCharactersInStrings("hellothere") + try: + api_response = api_instance.post_nul_characters_in_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_nul_characters_in_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NulCharactersInStrings**](NulCharactersInStrings.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_null_type_matches_only_the_null_object_request_body** +> post_null_type_matches_only_the_null_object_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**none_type** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_number_type_matches_numbers_request_body** +> post_number_type_matches_numbers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = 3.14 + try: + api_response = api_instance.post_number_type_matches_numbers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_number_type_matches_numbers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int, float** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_properties_validation_request_body** +> post_object_properties_validation_request_body(object_properties_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = ObjectPropertiesValidation(None) + try: + api_response = api_instance.post_object_properties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_object_properties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ObjectPropertiesValidation**](ObjectPropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_type_matches_objects_request_body** +> post_object_type_matches_objects_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = dict() + try: + api_response = api_instance.post_object_type_matches_objects_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_object_type_matches_objects_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_complex_types_request_body** +> post_oneof_complex_types_request_body(oneof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.oneof_complex_types import OneofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofComplexTypes(None) + try: + api_response = api_instance.post_oneof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_oneof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofComplexTypes**](OneofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_request_body** +> post_oneof_request_body(oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.oneof import Oneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = Oneof(None) + try: + api_response = api_instance.post_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Oneof**](Oneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_base_schema_request_body** +> post_oneof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithBaseSchema("body_example") + try: + api_response = api_instance.post_oneof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_oneof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithBaseSchema**](OneofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_empty_schema_request_body** +> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithEmptySchema(None) + try: + api_response = api_instance.post_oneof_with_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_oneof_with_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithEmptySchema**](OneofWithEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_is_not_anchored_request_body** +> post_pattern_is_not_anchored_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternIsNotAnchored(None) + try: + api_response = api_instance.post_pattern_is_not_anchored_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_pattern_is_not_anchored_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternIsNotAnchored**](PatternIsNotAnchored.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_validation_request_body** +> post_pattern_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.pattern_validation import PatternValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternValidation(None) + try: + api_response = api_instance.post_pattern_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_pattern_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternValidation**](PatternValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_properties_with_escaped_characters_request_body** +> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertiesWithEscapedCharacters(None) + try: + api_response = api_instance.post_properties_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_properties_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertiesWithEscapedCharacters**](PropertiesWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_property_named_ref_that_is_not_a_reference_request_body** +> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertyNamedRefThatIsNotAReference(None) + try: + api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_additionalproperties_request_body** +> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAdditionalproperties( + key=PropertyNamedRefThatIsNotAReference(None), + ) + try: + api_response = api_instance.post_ref_in_additionalproperties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_additionalproperties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAdditionalproperties**](RefInAdditionalproperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_allof_request_body** +> post_ref_in_allof_request_body(ref_in_allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_allof import RefInAllof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAllof(None) + try: + api_response = api_instance.post_ref_in_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAllof**](RefInAllof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_anyof_request_body** +> post_ref_in_anyof_request_body(ref_in_anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_anyof import RefInAnyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAnyof(None) + try: + api_response = api_instance.post_ref_in_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAnyof**](RefInAnyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_items_request_body** +> post_ref_in_items_request_body(ref_in_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_items import RefInItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInItems([ + PropertyNamedRefThatIsNotAReference(None) + ]) + try: + api_response = api_instance.post_ref_in_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInItems**](RefInItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_oneof_request_body** +> post_ref_in_oneof_request_body(ref_in_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_oneof import RefInOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInOneof(None) + try: + api_response = api_instance.post_ref_in_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInOneof**](RefInOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_property_request_body** +> post_ref_in_property_request_body(ref_in_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.ref_in_property import RefInProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInProperty(None) + try: + api_response = api_instance.post_ref_in_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_ref_in_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInProperty**](RefInProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_default_validation_request_body** +> post_required_default_validation_request_body(required_default_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.required_default_validation import RequiredDefaultValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredDefaultValidation(None) + try: + api_response = api_instance.post_required_default_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_required_default_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredDefaultValidation**](RequiredDefaultValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_validation_request_body** +> post_required_validation_request_body(required_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.required_validation import RequiredValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredValidation(None) + try: + api_response = api_instance.post_required_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_required_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredValidation**](RequiredValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_with_empty_array_request_body** +> post_required_with_empty_array_request_body(required_with_empty_array) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredWithEmptyArray(None) + try: + api_response = api_instance.post_required_with_empty_array_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_required_with_empty_array_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredWithEmptyArray**](RequiredWithEmptyArray.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_simple_enum_validation_request_body** +> post_simple_enum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = SimpleEnumValidation(1) + try: + api_response = api_instance.post_simple_enum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_simple_enum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**SimpleEnumValidation**](SimpleEnumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_string_type_matches_strings_request_body** +> post_string_type_matches_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = "body_example" + try: + api_response = api_instance.post_string_type_matches_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_string_type_matches_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** +> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + alpha=5, + ) + try: + api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_false_validation_request_body** +> post_uniqueitems_false_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsFalseValidation(None) + try: + api_response = api_instance.post_uniqueitems_false_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_uniqueitems_false_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsFalseValidation**](UniqueitemsFalseValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_validation_request_body** +> post_uniqueitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsValidation(None) + try: + api_response = api_instance.post_uniqueitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_uniqueitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsValidation**](UniqueitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_format_request_body** +> post_uri_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_uri_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_reference_format_request_body** +> post_uri_reference_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_reference_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_uri_reference_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_template_format_request_body** +> post_uri_template_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import post_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = post_api.PostApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_template_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling PostApi->post_uri_template_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/RequestBodyApi.md b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/RequestBodyApi.md new file mode 100644 index 00000000000..b62f342c75b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/RequestBodyApi.md @@ -0,0 +1,6243 @@ +# unit_test_api.RequestBodyApi + +All URIs are relative to *https://someserver.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](RequestBodyApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **POST** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody | +[**post_additionalproperties_are_allowed_by_default_request_body**](RequestBodyApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **POST** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody | +[**post_additionalproperties_can_exist_by_itself_request_body**](RequestBodyApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **POST** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody | +[**post_additionalproperties_should_not_look_in_applicators_request_body**](RequestBodyApi.md#post_additionalproperties_should_not_look_in_applicators_request_body) | **POST** /requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody | +[**post_allof_combined_with_anyof_oneof_request_body**](RequestBodyApi.md#post_allof_combined_with_anyof_oneof_request_body) | **POST** /requestBody/postAllofCombinedWithAnyofOneofRequestBody | +[**post_allof_request_body**](RequestBodyApi.md#post_allof_request_body) | **POST** /requestBody/postAllofRequestBody | +[**post_allof_simple_types_request_body**](RequestBodyApi.md#post_allof_simple_types_request_body) | **POST** /requestBody/postAllofSimpleTypesRequestBody | +[**post_allof_with_base_schema_request_body**](RequestBodyApi.md#post_allof_with_base_schema_request_body) | **POST** /requestBody/postAllofWithBaseSchemaRequestBody | +[**post_allof_with_one_empty_schema_request_body**](RequestBodyApi.md#post_allof_with_one_empty_schema_request_body) | **POST** /requestBody/postAllofWithOneEmptySchemaRequestBody | +[**post_allof_with_the_first_empty_schema_request_body**](RequestBodyApi.md#post_allof_with_the_first_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheFirstEmptySchemaRequestBody | +[**post_allof_with_the_last_empty_schema_request_body**](RequestBodyApi.md#post_allof_with_the_last_empty_schema_request_body) | **POST** /requestBody/postAllofWithTheLastEmptySchemaRequestBody | +[**post_allof_with_two_empty_schemas_request_body**](RequestBodyApi.md#post_allof_with_two_empty_schemas_request_body) | **POST** /requestBody/postAllofWithTwoEmptySchemasRequestBody | +[**post_anyof_complex_types_request_body**](RequestBodyApi.md#post_anyof_complex_types_request_body) | **POST** /requestBody/postAnyofComplexTypesRequestBody | +[**post_anyof_request_body**](RequestBodyApi.md#post_anyof_request_body) | **POST** /requestBody/postAnyofRequestBody | +[**post_anyof_with_base_schema_request_body**](RequestBodyApi.md#post_anyof_with_base_schema_request_body) | **POST** /requestBody/postAnyofWithBaseSchemaRequestBody | +[**post_anyof_with_one_empty_schema_request_body**](RequestBodyApi.md#post_anyof_with_one_empty_schema_request_body) | **POST** /requestBody/postAnyofWithOneEmptySchemaRequestBody | +[**post_array_type_matches_arrays_request_body**](RequestBodyApi.md#post_array_type_matches_arrays_request_body) | **POST** /requestBody/postArrayTypeMatchesArraysRequestBody | +[**post_boolean_type_matches_booleans_request_body**](RequestBodyApi.md#post_boolean_type_matches_booleans_request_body) | **POST** /requestBody/postBooleanTypeMatchesBooleansRequestBody | +[**post_by_int_request_body**](RequestBodyApi.md#post_by_int_request_body) | **POST** /requestBody/postByIntRequestBody | +[**post_by_number_request_body**](RequestBodyApi.md#post_by_number_request_body) | **POST** /requestBody/postByNumberRequestBody | +[**post_by_small_number_request_body**](RequestBodyApi.md#post_by_small_number_request_body) | **POST** /requestBody/postBySmallNumberRequestBody | +[**post_date_time_format_request_body**](RequestBodyApi.md#post_date_time_format_request_body) | **POST** /requestBody/postDateTimeFormatRequestBody | +[**post_email_format_request_body**](RequestBodyApi.md#post_email_format_request_body) | **POST** /requestBody/postEmailFormatRequestBody | +[**post_enum_with0_does_not_match_false_request_body**](RequestBodyApi.md#post_enum_with0_does_not_match_false_request_body) | **POST** /requestBody/postEnumWith0DoesNotMatchFalseRequestBody | +[**post_enum_with1_does_not_match_true_request_body**](RequestBodyApi.md#post_enum_with1_does_not_match_true_request_body) | **POST** /requestBody/postEnumWith1DoesNotMatchTrueRequestBody | +[**post_enum_with_escaped_characters_request_body**](RequestBodyApi.md#post_enum_with_escaped_characters_request_body) | **POST** /requestBody/postEnumWithEscapedCharactersRequestBody | +[**post_enum_with_false_does_not_match0_request_body**](RequestBodyApi.md#post_enum_with_false_does_not_match0_request_body) | **POST** /requestBody/postEnumWithFalseDoesNotMatch0RequestBody | +[**post_enum_with_true_does_not_match1_request_body**](RequestBodyApi.md#post_enum_with_true_does_not_match1_request_body) | **POST** /requestBody/postEnumWithTrueDoesNotMatch1RequestBody | +[**post_enums_in_properties_request_body**](RequestBodyApi.md#post_enums_in_properties_request_body) | **POST** /requestBody/postEnumsInPropertiesRequestBody | +[**post_forbidden_property_request_body**](RequestBodyApi.md#post_forbidden_property_request_body) | **POST** /requestBody/postForbiddenPropertyRequestBody | +[**post_hostname_format_request_body**](RequestBodyApi.md#post_hostname_format_request_body) | **POST** /requestBody/postHostnameFormatRequestBody | +[**post_integer_type_matches_integers_request_body**](RequestBodyApi.md#post_integer_type_matches_integers_request_body) | **POST** /requestBody/postIntegerTypeMatchesIntegersRequestBody | +[**post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body**](RequestBodyApi.md#post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body) | **POST** /requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody | +[**post_invalid_string_value_for_default_request_body**](RequestBodyApi.md#post_invalid_string_value_for_default_request_body) | **POST** /requestBody/postInvalidStringValueForDefaultRequestBody | +[**post_ipv4_format_request_body**](RequestBodyApi.md#post_ipv4_format_request_body) | **POST** /requestBody/postIpv4FormatRequestBody | +[**post_ipv6_format_request_body**](RequestBodyApi.md#post_ipv6_format_request_body) | **POST** /requestBody/postIpv6FormatRequestBody | +[**post_json_pointer_format_request_body**](RequestBodyApi.md#post_json_pointer_format_request_body) | **POST** /requestBody/postJsonPointerFormatRequestBody | +[**post_maximum_validation_request_body**](RequestBodyApi.md#post_maximum_validation_request_body) | **POST** /requestBody/postMaximumValidationRequestBody | +[**post_maximum_validation_with_unsigned_integer_request_body**](RequestBodyApi.md#post_maximum_validation_with_unsigned_integer_request_body) | **POST** /requestBody/postMaximumValidationWithUnsignedIntegerRequestBody | +[**post_maxitems_validation_request_body**](RequestBodyApi.md#post_maxitems_validation_request_body) | **POST** /requestBody/postMaxitemsValidationRequestBody | +[**post_maxlength_validation_request_body**](RequestBodyApi.md#post_maxlength_validation_request_body) | **POST** /requestBody/postMaxlengthValidationRequestBody | +[**post_maxproperties0_means_the_object_is_empty_request_body**](RequestBodyApi.md#post_maxproperties0_means_the_object_is_empty_request_body) | **POST** /requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody | +[**post_maxproperties_validation_request_body**](RequestBodyApi.md#post_maxproperties_validation_request_body) | **POST** /requestBody/postMaxpropertiesValidationRequestBody | +[**post_minimum_validation_request_body**](RequestBodyApi.md#post_minimum_validation_request_body) | **POST** /requestBody/postMinimumValidationRequestBody | +[**post_minimum_validation_with_signed_integer_request_body**](RequestBodyApi.md#post_minimum_validation_with_signed_integer_request_body) | **POST** /requestBody/postMinimumValidationWithSignedIntegerRequestBody | +[**post_minitems_validation_request_body**](RequestBodyApi.md#post_minitems_validation_request_body) | **POST** /requestBody/postMinitemsValidationRequestBody | +[**post_minlength_validation_request_body**](RequestBodyApi.md#post_minlength_validation_request_body) | **POST** /requestBody/postMinlengthValidationRequestBody | +[**post_minproperties_validation_request_body**](RequestBodyApi.md#post_minproperties_validation_request_body) | **POST** /requestBody/postMinpropertiesValidationRequestBody | +[**post_nested_allof_to_check_validation_semantics_request_body**](RequestBodyApi.md#post_nested_allof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAllofToCheckValidationSemanticsRequestBody | +[**post_nested_anyof_to_check_validation_semantics_request_body**](RequestBodyApi.md#post_nested_anyof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody | +[**post_nested_items_request_body**](RequestBodyApi.md#post_nested_items_request_body) | **POST** /requestBody/postNestedItemsRequestBody | +[**post_nested_oneof_to_check_validation_semantics_request_body**](RequestBodyApi.md#post_nested_oneof_to_check_validation_semantics_request_body) | **POST** /requestBody/postNestedOneofToCheckValidationSemanticsRequestBody | +[**post_not_more_complex_schema_request_body**](RequestBodyApi.md#post_not_more_complex_schema_request_body) | **POST** /requestBody/postNotMoreComplexSchemaRequestBody | +[**post_not_request_body**](RequestBodyApi.md#post_not_request_body) | **POST** /requestBody/postNotRequestBody | +[**post_nul_characters_in_strings_request_body**](RequestBodyApi.md#post_nul_characters_in_strings_request_body) | **POST** /requestBody/postNulCharactersInStringsRequestBody | +[**post_null_type_matches_only_the_null_object_request_body**](RequestBodyApi.md#post_null_type_matches_only_the_null_object_request_body) | **POST** /requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody | +[**post_number_type_matches_numbers_request_body**](RequestBodyApi.md#post_number_type_matches_numbers_request_body) | **POST** /requestBody/postNumberTypeMatchesNumbersRequestBody | +[**post_object_properties_validation_request_body**](RequestBodyApi.md#post_object_properties_validation_request_body) | **POST** /requestBody/postObjectPropertiesValidationRequestBody | +[**post_object_type_matches_objects_request_body**](RequestBodyApi.md#post_object_type_matches_objects_request_body) | **POST** /requestBody/postObjectTypeMatchesObjectsRequestBody | +[**post_oneof_complex_types_request_body**](RequestBodyApi.md#post_oneof_complex_types_request_body) | **POST** /requestBody/postOneofComplexTypesRequestBody | +[**post_oneof_request_body**](RequestBodyApi.md#post_oneof_request_body) | **POST** /requestBody/postOneofRequestBody | +[**post_oneof_with_base_schema_request_body**](RequestBodyApi.md#post_oneof_with_base_schema_request_body) | **POST** /requestBody/postOneofWithBaseSchemaRequestBody | +[**post_oneof_with_empty_schema_request_body**](RequestBodyApi.md#post_oneof_with_empty_schema_request_body) | **POST** /requestBody/postOneofWithEmptySchemaRequestBody | +[**post_pattern_is_not_anchored_request_body**](RequestBodyApi.md#post_pattern_is_not_anchored_request_body) | **POST** /requestBody/postPatternIsNotAnchoredRequestBody | +[**post_pattern_validation_request_body**](RequestBodyApi.md#post_pattern_validation_request_body) | **POST** /requestBody/postPatternValidationRequestBody | +[**post_properties_with_escaped_characters_request_body**](RequestBodyApi.md#post_properties_with_escaped_characters_request_body) | **POST** /requestBody/postPropertiesWithEscapedCharactersRequestBody | +[**post_property_named_ref_that_is_not_a_reference_request_body**](RequestBodyApi.md#post_property_named_ref_that_is_not_a_reference_request_body) | **POST** /requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody | +[**post_ref_in_additionalproperties_request_body**](RequestBodyApi.md#post_ref_in_additionalproperties_request_body) | **POST** /requestBody/postRefInAdditionalpropertiesRequestBody | +[**post_ref_in_allof_request_body**](RequestBodyApi.md#post_ref_in_allof_request_body) | **POST** /requestBody/postRefInAllofRequestBody | +[**post_ref_in_anyof_request_body**](RequestBodyApi.md#post_ref_in_anyof_request_body) | **POST** /requestBody/postRefInAnyofRequestBody | +[**post_ref_in_items_request_body**](RequestBodyApi.md#post_ref_in_items_request_body) | **POST** /requestBody/postRefInItemsRequestBody | +[**post_ref_in_oneof_request_body**](RequestBodyApi.md#post_ref_in_oneof_request_body) | **POST** /requestBody/postRefInOneofRequestBody | +[**post_ref_in_property_request_body**](RequestBodyApi.md#post_ref_in_property_request_body) | **POST** /requestBody/postRefInPropertyRequestBody | +[**post_required_default_validation_request_body**](RequestBodyApi.md#post_required_default_validation_request_body) | **POST** /requestBody/postRequiredDefaultValidationRequestBody | +[**post_required_validation_request_body**](RequestBodyApi.md#post_required_validation_request_body) | **POST** /requestBody/postRequiredValidationRequestBody | +[**post_required_with_empty_array_request_body**](RequestBodyApi.md#post_required_with_empty_array_request_body) | **POST** /requestBody/postRequiredWithEmptyArrayRequestBody | +[**post_simple_enum_validation_request_body**](RequestBodyApi.md#post_simple_enum_validation_request_body) | **POST** /requestBody/postSimpleEnumValidationRequestBody | +[**post_string_type_matches_strings_request_body**](RequestBodyApi.md#post_string_type_matches_strings_request_body) | **POST** /requestBody/postStringTypeMatchesStringsRequestBody | +[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](RequestBodyApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **POST** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody | +[**post_uniqueitems_false_validation_request_body**](RequestBodyApi.md#post_uniqueitems_false_validation_request_body) | **POST** /requestBody/postUniqueitemsFalseValidationRequestBody | +[**post_uniqueitems_validation_request_body**](RequestBodyApi.md#post_uniqueitems_validation_request_body) | **POST** /requestBody/postUniqueitemsValidationRequestBody | +[**post_uri_format_request_body**](RequestBodyApi.md#post_uri_format_request_body) | **POST** /requestBody/postUriFormatRequestBody | +[**post_uri_reference_format_request_body**](RequestBodyApi.md#post_uri_reference_format_request_body) | **POST** /requestBody/postUriReferenceFormatRequestBody | +[**post_uri_template_format_request_body**](RequestBodyApi.md#post_uri_template_format_request_body) | **POST** /requestBody/postUriTemplateFormatRequestBody | + +# **post_additionalproperties_allows_a_schema_which_should_validate_request_body** +> post_additionalproperties_allows_a_schema_which_should_validate_request_body(additionalproperties_allows_a_schema_which_should_validate) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAllowsASchemaWhichShouldValidate( + foo=None, + bar=None, + ) + try: + api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_additionalproperties_allows_a_schema_which_should_validate_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAllowsASchemaWhichShouldValidate**](AdditionalpropertiesAllowsASchemaWhichShouldValidate.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_are_allowed_by_default_request_body** +> post_additionalproperties_are_allowed_by_default_request_body(additionalproperties_are_allowed_by_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesAreAllowedByDefault(None) + try: + api_response = api_instance.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_additionalproperties_are_allowed_by_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesAreAllowedByDefault**](AdditionalpropertiesAreAllowedByDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_can_exist_by_itself_request_body** +> post_additionalproperties_can_exist_by_itself_request_body(additionalproperties_can_exist_by_itself) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesCanExistByItself( + key=True, + ) + try: + api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_additionalproperties_can_exist_by_itself_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesCanExistByItself**](AdditionalpropertiesCanExistByItself.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_additionalproperties_should_not_look_in_applicators_request_body** +> post_additionalproperties_should_not_look_in_applicators_request_body(additionalproperties_should_not_look_in_applicators) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AdditionalpropertiesShouldNotLookInApplicators(None) + try: + api_response = api_instance.post_additionalproperties_should_not_look_in_applicators_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_additionalproperties_should_not_look_in_applicators_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalpropertiesShouldNotLookInApplicators**](AdditionalpropertiesShouldNotLookInApplicators.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_combined_with_anyof_oneof_request_body** +> post_allof_combined_with_anyof_oneof_request_body(allof_combined_with_anyof_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofCombinedWithAnyofOneof(None) + try: + api_response = api_instance.post_allof_combined_with_anyof_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_combined_with_anyof_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofCombinedWithAnyofOneof**](AllofCombinedWithAnyofOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_request_body** +> post_allof_request_body(allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof import Allof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = Allof(None) + try: + api_response = api_instance.post_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Allof**](Allof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_simple_types_request_body** +> post_allof_simple_types_request_body(allof_simple_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_simple_types import AllofSimpleTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofSimpleTypes(None) + try: + api_response = api_instance.post_allof_simple_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_simple_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofSimpleTypes**](AllofSimpleTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_base_schema_request_body** +> post_allof_with_base_schema_request_body(allof_with_base_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithBaseSchema({}) + try: + api_response = api_instance.post_allof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithBaseSchema**](AllofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_one_empty_schema_request_body** +> post_allof_with_one_empty_schema_request_body(allof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithOneEmptySchema(None) + try: + api_response = api_instance.post_allof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithOneEmptySchema**](AllofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_first_empty_schema_request_body** +> post_allof_with_the_first_empty_schema_request_body(allof_with_the_first_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheFirstEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_first_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_with_the_first_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheFirstEmptySchema**](AllofWithTheFirstEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_the_last_empty_schema_request_body** +> post_allof_with_the_last_empty_schema_request_body(allof_with_the_last_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTheLastEmptySchema(None) + try: + api_response = api_instance.post_allof_with_the_last_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_with_the_last_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTheLastEmptySchema**](AllofWithTheLastEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_allof_with_two_empty_schemas_request_body** +> post_allof_with_two_empty_schemas_request_body(allof_with_two_empty_schemas) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AllofWithTwoEmptySchemas(None) + try: + api_response = api_instance.post_allof_with_two_empty_schemas_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_allof_with_two_empty_schemas_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AllofWithTwoEmptySchemas**](AllofWithTwoEmptySchemas.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_complex_types_request_body** +> post_anyof_complex_types_request_body(anyof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofComplexTypes(None) + try: + api_response = api_instance.post_anyof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_anyof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofComplexTypes**](AnyofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_request_body** +> post_anyof_request_body(anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.anyof import Anyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = Anyof(None) + try: + api_response = api_instance.post_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Anyof**](Anyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_base_schema_request_body** +> post_anyof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithBaseSchema("body_example") + try: + api_response = api_instance.post_anyof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_anyof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithBaseSchema**](AnyofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_anyof_with_one_empty_schema_request_body** +> post_anyof_with_one_empty_schema_request_body(anyof_with_one_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = AnyofWithOneEmptySchema(None) + try: + api_response = api_instance.post_anyof_with_one_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_anyof_with_one_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnyofWithOneEmptySchema**](AnyofWithOneEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_array_type_matches_arrays_request_body** +> post_array_type_matches_arrays_request_body(array_type_matches_arrays) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ArrayTypeMatchesArrays([ + None + ]) + try: + api_response = api_instance.post_array_type_matches_arrays_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_array_type_matches_arrays_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ArrayTypeMatchesArrays**](ArrayTypeMatchesArrays.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boolean_type_matches_booleans_request_body** +> post_boolean_type_matches_booleans_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = True + try: + api_response = api_instance.post_boolean_type_matches_booleans_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_boolean_type_matches_booleans_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_int_request_body** +> post_by_int_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.by_int import ByInt +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ByInt(None) + try: + api_response = api_instance.post_by_int_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_by_int_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByInt**](ByInt.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_number_request_body** +> post_by_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.by_number import ByNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ByNumber(None) + try: + api_response = api_instance.post_by_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_by_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ByNumber**](ByNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_by_small_number_request_body** +> post_by_small_number_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.by_small_number import BySmallNumber +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = BySmallNumber(None) + try: + api_response = api_instance.post_by_small_number_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_by_small_number_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**BySmallNumber**](BySmallNumber.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_date_time_format_request_body** +> post_date_time_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_date_time_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_date_time_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_email_format_request_body** +> post_email_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_email_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_email_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with0_does_not_match_false_request_body** +> post_enum_with0_does_not_match_false_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith0DoesNotMatchFalse(0) + try: + api_response = api_instance.post_enum_with0_does_not_match_false_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enum_with0_does_not_match_false_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith0DoesNotMatchFalse**](EnumWith0DoesNotMatchFalse.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with1_does_not_match_true_request_body** +> post_enum_with1_does_not_match_true_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWith1DoesNotMatchTrue(1) + try: + api_response = api_instance.post_enum_with1_does_not_match_true_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enum_with1_does_not_match_true_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWith1DoesNotMatchTrue**](EnumWith1DoesNotMatchTrue.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_escaped_characters_request_body** +> post_enum_with_escaped_characters_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithEscapedCharacters("foo +bar") + try: + api_response = api_instance.post_enum_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enum_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithEscapedCharacters**](EnumWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_false_does_not_match0_request_body** +> post_enum_with_false_does_not_match0_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithFalseDoesNotMatch0(False) + try: + api_response = api_instance.post_enum_with_false_does_not_match0_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enum_with_false_does_not_match0_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithFalseDoesNotMatch0**](EnumWithFalseDoesNotMatch0.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enum_with_true_does_not_match1_request_body** +> post_enum_with_true_does_not_match1_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumWithTrueDoesNotMatch1(True) + try: + api_response = api_instance.post_enum_with_true_does_not_match1_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enum_with_true_does_not_match1_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumWithTrueDoesNotMatch1**](EnumWithTrueDoesNotMatch1.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_enums_in_properties_request_body** +> post_enums_in_properties_request_body(enums_in_properties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.enums_in_properties import EnumsInProperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = EnumsInProperties( + foo="foo", + bar="bar", + ) + try: + api_response = api_instance.post_enums_in_properties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_enums_in_properties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**EnumsInProperties**](EnumsInProperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_forbidden_property_request_body** +> post_forbidden_property_request_body(forbidden_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.forbidden_property import ForbiddenProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ForbiddenProperty(None) + try: + api_response = api_instance.post_forbidden_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_forbidden_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ForbiddenProperty**](ForbiddenProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_hostname_format_request_body** +> post_hostname_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_hostname_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_hostname_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_integer_type_matches_integers_request_body** +> post_integer_type_matches_integers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = 1 + try: + api_response = api_instance.post_integer_type_matches_integers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_integer_type_matches_integers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body** +> post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(1) + try: + api_response = api_instance.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf**](InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_invalid_string_value_for_default_request_body** +> post_invalid_string_value_for_default_request_body(invalid_string_value_for_default) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = InvalidStringValueForDefault(None) + try: + api_response = api_instance.post_invalid_string_value_for_default_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_invalid_string_value_for_default_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InvalidStringValueForDefault**](InvalidStringValueForDefault.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv4_format_request_body** +> post_ipv4_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv4_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ipv4_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ipv6_format_request_body** +> post_ipv6_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_ipv6_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ipv6_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_json_pointer_format_request_body** +> post_json_pointer_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_json_pointer_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_json_pointer_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_request_body** +> post_maximum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maximum_validation import MaximumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidation(None) + try: + api_response = api_instance.post_maximum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maximum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidation**](MaximumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maximum_validation_with_unsigned_integer_request_body** +> post_maximum_validation_with_unsigned_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MaximumValidationWithUnsignedInteger(None) + try: + api_response = api_instance.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maximum_validation_with_unsigned_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaximumValidationWithUnsignedInteger**](MaximumValidationWithUnsignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxitems_validation_request_body** +> post_maxitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maxitems_validation import MaxitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxitemsValidation(None) + try: + api_response = api_instance.post_maxitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maxitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxitemsValidation**](MaxitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxlength_validation_request_body** +> post_maxlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maxlength_validation import MaxlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxlengthValidation(None) + try: + api_response = api_instance.post_maxlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maxlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxlengthValidation**](MaxlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties0_means_the_object_is_empty_request_body** +> post_maxproperties0_means_the_object_is_empty_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = Maxproperties0MeansTheObjectIsEmpty(None) + try: + api_response = api_instance.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maxproperties0_means_the_object_is_empty_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Maxproperties0MeansTheObjectIsEmpty**](Maxproperties0MeansTheObjectIsEmpty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_maxproperties_validation_request_body** +> post_maxproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MaxpropertiesValidation(None) + try: + api_response = api_instance.post_maxproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_maxproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MaxpropertiesValidation**](MaxpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_request_body** +> post_minimum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.minimum_validation import MinimumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidation(None) + try: + api_response = api_instance.post_minimum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_minimum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidation**](MinimumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minimum_validation_with_signed_integer_request_body** +> post_minimum_validation_with_signed_integer_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MinimumValidationWithSignedInteger(None) + try: + api_response = api_instance.post_minimum_validation_with_signed_integer_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_minimum_validation_with_signed_integer_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinimumValidationWithSignedInteger**](MinimumValidationWithSignedInteger.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minitems_validation_request_body** +> post_minitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.minitems_validation import MinitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MinitemsValidation(None) + try: + api_response = api_instance.post_minitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_minitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinitemsValidation**](MinitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minlength_validation_request_body** +> post_minlength_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.minlength_validation import MinlengthValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MinlengthValidation(None) + try: + api_response = api_instance.post_minlength_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_minlength_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinlengthValidation**](MinlengthValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_minproperties_validation_request_body** +> post_minproperties_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.minproperties_validation import MinpropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = MinpropertiesValidation(None) + try: + api_response = api_instance.post_minproperties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_minproperties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**MinpropertiesValidation**](MinpropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_allof_to_check_validation_semantics_request_body** +> post_nested_allof_to_check_validation_semantics_request_body(nested_allof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAllofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_nested_allof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAllofToCheckValidationSemantics**](NestedAllofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_anyof_to_check_validation_semantics_request_body** +> post_nested_anyof_to_check_validation_semantics_request_body(nested_anyof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedAnyofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_nested_anyof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedAnyofToCheckValidationSemantics**](NestedAnyofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_items_request_body** +> post_nested_items_request_body(nested_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.nested_items import NestedItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedItems([ + [ + [ + [ + 3.14 + ] + ] + ] + ]) + try: + api_response = api_instance.post_nested_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_nested_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedItems**](NestedItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nested_oneof_to_check_validation_semantics_request_body** +> post_nested_oneof_to_check_validation_semantics_request_body(nested_oneof_to_check_validation_semantics) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = NestedOneofToCheckValidationSemantics(None) + try: + api_response = api_instance.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_nested_oneof_to_check_validation_semantics_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NestedOneofToCheckValidationSemantics**](NestedOneofToCheckValidationSemantics.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_more_complex_schema_request_body** +> post_not_more_complex_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_more_complex_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_not_more_complex_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_not_request_body** +> post_not_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_not_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_not_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_nul_characters_in_strings_request_body** +> post_nul_characters_in_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = NulCharactersInStrings("hellothere") + try: + api_response = api_instance.post_nul_characters_in_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_nul_characters_in_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NulCharactersInStrings**](NulCharactersInStrings.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_null_type_matches_only_the_null_object_request_body** +> post_null_type_matches_only_the_null_object_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_null_type_matches_only_the_null_object_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_null_type_matches_only_the_null_object_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**none_type** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_number_type_matches_numbers_request_body** +> post_number_type_matches_numbers_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = 3.14 + try: + api_response = api_instance.post_number_type_matches_numbers_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_number_type_matches_numbers_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**int, float** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_properties_validation_request_body** +> post_object_properties_validation_request_body(object_properties_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = ObjectPropertiesValidation(None) + try: + api_response = api_instance.post_object_properties_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_object_properties_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ObjectPropertiesValidation**](ObjectPropertiesValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_object_type_matches_objects_request_body** +> post_object_type_matches_objects_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = dict() + try: + api_response = api_instance.post_object_type_matches_objects_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_object_type_matches_objects_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_complex_types_request_body** +> post_oneof_complex_types_request_body(oneof_complex_types) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.oneof_complex_types import OneofComplexTypes +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofComplexTypes(None) + try: + api_response = api_instance.post_oneof_complex_types_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_oneof_complex_types_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofComplexTypes**](OneofComplexTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_request_body** +> post_oneof_request_body(oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.oneof import Oneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = Oneof(None) + try: + api_response = api_instance.post_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Oneof**](Oneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_base_schema_request_body** +> post_oneof_with_base_schema_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithBaseSchema("body_example") + try: + api_response = api_instance.post_oneof_with_base_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_oneof_with_base_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithBaseSchema**](OneofWithBaseSchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_oneof_with_empty_schema_request_body** +> post_oneof_with_empty_schema_request_body(oneof_with_empty_schema) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = OneofWithEmptySchema(None) + try: + api_response = api_instance.post_oneof_with_empty_schema_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_oneof_with_empty_schema_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OneofWithEmptySchema**](OneofWithEmptySchema.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_is_not_anchored_request_body** +> post_pattern_is_not_anchored_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternIsNotAnchored(None) + try: + api_response = api_instance.post_pattern_is_not_anchored_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_pattern_is_not_anchored_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternIsNotAnchored**](PatternIsNotAnchored.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_pattern_validation_request_body** +> post_pattern_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.pattern_validation import PatternValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = PatternValidation(None) + try: + api_response = api_instance.post_pattern_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_pattern_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PatternValidation**](PatternValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_properties_with_escaped_characters_request_body** +> post_properties_with_escaped_characters_request_body(properties_with_escaped_characters) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertiesWithEscapedCharacters(None) + try: + api_response = api_instance.post_properties_with_escaped_characters_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_properties_with_escaped_characters_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertiesWithEscapedCharacters**](PropertiesWithEscapedCharacters.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_property_named_ref_that_is_not_a_reference_request_body** +> post_property_named_ref_that_is_not_a_reference_request_body(property_named_ref_that_is_not_a_reference) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = PropertyNamedRefThatIsNotAReference(None) + try: + api_response = api_instance.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_property_named_ref_that_is_not_a_reference_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**PropertyNamedRefThatIsNotAReference**](PropertyNamedRefThatIsNotAReference.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_additionalproperties_request_body** +> post_ref_in_additionalproperties_request_body(ref_in_additionalproperties) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAdditionalproperties( + key=PropertyNamedRefThatIsNotAReference(None), + ) + try: + api_response = api_instance.post_ref_in_additionalproperties_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_additionalproperties_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAdditionalproperties**](RefInAdditionalproperties.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_allof_request_body** +> post_ref_in_allof_request_body(ref_in_allof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_allof import RefInAllof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAllof(None) + try: + api_response = api_instance.post_ref_in_allof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_allof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAllof**](RefInAllof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_anyof_request_body** +> post_ref_in_anyof_request_body(ref_in_anyof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_anyof import RefInAnyof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInAnyof(None) + try: + api_response = api_instance.post_ref_in_anyof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_anyof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInAnyof**](RefInAnyof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_items_request_body** +> post_ref_in_items_request_body(ref_in_items) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_items import RefInItems +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInItems([ + PropertyNamedRefThatIsNotAReference(None) + ]) + try: + api_response = api_instance.post_ref_in_items_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_items_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInItems**](RefInItems.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_oneof_request_body** +> post_ref_in_oneof_request_body(ref_in_oneof) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_oneof import RefInOneof +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInOneof(None) + try: + api_response = api_instance.post_ref_in_oneof_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_oneof_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInOneof**](RefInOneof.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ref_in_property_request_body** +> post_ref_in_property_request_body(ref_in_property) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.ref_in_property import RefInProperty +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RefInProperty(None) + try: + api_response = api_instance.post_ref_in_property_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_ref_in_property_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RefInProperty**](RefInProperty.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_default_validation_request_body** +> post_required_default_validation_request_body(required_default_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.required_default_validation import RequiredDefaultValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredDefaultValidation(None) + try: + api_response = api_instance.post_required_default_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_required_default_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredDefaultValidation**](RequiredDefaultValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_validation_request_body** +> post_required_validation_request_body(required_validation) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.required_validation import RequiredValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredValidation(None) + try: + api_response = api_instance.post_required_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_required_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredValidation**](RequiredValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_required_with_empty_array_request_body** +> post_required_with_empty_array_request_body(required_with_empty_array) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = RequiredWithEmptyArray(None) + try: + api_response = api_instance.post_required_with_empty_array_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_required_with_empty_array_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**RequiredWithEmptyArray**](RequiredWithEmptyArray.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_simple_enum_validation_request_body** +> post_simple_enum_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = SimpleEnumValidation(1) + try: + api_response = api_instance.post_simple_enum_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_simple_enum_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**SimpleEnumValidation**](SimpleEnumValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_string_type_matches_strings_request_body** +> post_string_type_matches_strings_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = "body_example" + try: + api_response = api_instance.post_string_type_matches_strings_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_string_type_matches_strings_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body** +> post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(the_default_keyword_does_not_do_anything_if_the_property_is_missing) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( + alpha=5, + ) + try: + api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing**](TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_false_validation_request_body** +> post_uniqueitems_false_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsFalseValidation(None) + try: + api_response = api_instance.post_uniqueitems_false_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_uniqueitems_false_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsFalseValidation**](UniqueitemsFalseValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uniqueitems_validation_request_body** +> post_uniqueitems_validation_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = UniqueitemsValidation(None) + try: + api_response = api_instance.post_uniqueitems_validation_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_uniqueitems_validation_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**UniqueitemsValidation**](UniqueitemsValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_format_request_body** +> post_uri_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_uri_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_reference_format_request_body** +> post_uri_reference_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_reference_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_uri_reference_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_uri_template_format_request_body** +> post_uri_template_format_request_body(body) + + + +### Example + +```python +import unit_test_api +from unit_test_api.api import request_body_api +from pprint import pprint +# Defining the host is optional and defaults to https://someserver.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = unit_test_api.Configuration( + host = "https://someserver.com/v1" +) + +# Enter a context with an instance of the API client +with unit_test_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = request_body_api.RequestBodyApi(api_client) + + # example passing only required values which don't have defaults set + body = None + try: + api_response = api_instance.post_uri_template_format_request_body( + body=body, + ) + except unit_test_api.ApiException as e: + print("Exception when calling RequestBodyApi->post_uri_template_format_request_body: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py index e69de29bb2d..2d2e1b5c730 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py @@ -0,0 +1,68 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = 'application/json', + accept_content_type: typing.Optional[str] = 'application/json', + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_json_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_json_api.py new file mode 100644 index 00000000000..0a5f1e58a4c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_json_api.py @@ -0,0 +1,10585 @@ +# 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 unittest +from unittest.mock import patch + +import urllib3 + +import unit_test_api +from unit_test_api.api.json_api import JsonApi # noqa: E501 +from unit_test_api import configuration, schemas, api_client + +from . import ApiTestMixin + + +class TestJsonApi(ApiTestMixin, unittest.TestCase): + """JsonApi unit test stubs""" + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = JsonApi(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + def test_post_additionalproperties_allows_a_schema_which_should_validate_request_body(self): + """Test case for post_additionalproperties_allows_a_schema_which_should_validate_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_additionalproperties_allows_a_schema_which_should_validate_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_additional_properties_is_valid_passes + # no additional properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_are_allowed_by_default_request_body(self): + """Test case for post_additionalproperties_are_allowed_by_default_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_additionalproperties_are_allowed_by_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_additional_properties_are_allowed_passes + # additional properties are allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_can_exist_by_itself_request_body(self): + """Test case for post_additionalproperties_can_exist_by_itself_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_additionalproperties_can_exist_by_itself_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_can_exist_by_itself_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_should_not_look_in_applicators_request_body(self): + """Test case for post_additionalproperties_should_not_look_in_applicators_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_additionalproperties_should_not_look_in_applicators_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_properties_defined_in_allof_are_not_examined_fails + # properties defined in allOf are not examined + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + True, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + True, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_should_not_look_in_applicators_request_body(body=body) + + + + def test_post_allof_combined_with_anyof_oneof_request_body(self): + """Test case for post_allof_combined_with_anyof_oneof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_combined_with_anyof_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_true_anyof_false_oneof_false_fails + # allOf: true, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 2, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_true_fails + # allOf: false, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 5, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_true_fails + # allOf: false, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 15 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 15, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_false_fails + # allOf: true, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 6, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_true_passes + # allOf: true, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 30 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_combined_with_anyof_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofCombinedWithAnyofOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_allof_true_anyof_false_oneof_true_fails + # allOf: true, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 10, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_false_fails + # allOf: false, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_false_fails + # allOf: false, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + + + def test_post_allof_request_body(self): + """Test case for post_allof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_passes + # allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_fails + # mismatch first + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_mismatch_second_fails + # mismatch second + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_wrong_type_fails + # wrong type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + + + def test_post_allof_simple_types_request_body(self): + """Test case for post_allof_simple_types_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_simple_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 25 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_simple_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofSimpleTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_one_fails + # mismatch one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_allof_simple_types_request_body(body=body) + + + + def test_post_allof_with_base_schema_request_body(self): + """Test case for post_allof_with_base_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + "baz": + None, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_allof_fails + # mismatch first allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_both_fails + # mismatch both + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_second_allof_fails + # mismatch second allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + + + def test_post_allof_with_one_empty_schema_request_body(self): + """Test case for post_allof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_first_empty_schema_request_body(self): + """Test case for post_allof_with_the_first_empty_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_with_the_first_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_first_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_first_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_last_empty_schema_request_body(self): + """Test case for post_allof_with_the_last_empty_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_with_the_last_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_last_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_last_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheLastEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_two_empty_schemas_request_body(self): + """Test case for post_allof_with_two_empty_schemas_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_allof_with_two_empty_schemas_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_two_empty_schemas_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTwoEmptySchemasRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_complex_types_request_body(self): + """Test case for post_anyof_complex_types_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_anyof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_complex_passes + # second anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_complex_fails + # neither anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_anyof_complex_types_request_body(body=body) + + # test_both_anyof_valid_complex_passes + # both anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_complex_passes + # first anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_request_body(self): + """Test case for post_anyof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_passes + # second anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_fails + # neither anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_anyof_request_body(body=body) + + # test_both_anyof_valid_passes + # both anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_passes + # first anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_with_base_schema_request_body(self): + """Test case for post_anyof_with_base_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_anyof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_one_anyof_valid_passes + # one anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_anyof_invalid_fails + # both anyOf invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + + + def test_post_anyof_with_one_empty_schema_request_body(self): + """Test case for post_anyof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_anyof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_valid_passes + # string is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_array_type_matches_arrays_request_body(self): + """Test case for post_array_type_matches_arrays_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_array_type_matches_arrays_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_array_fails + # a float is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_boolean_is_not_an_array_fails + # a boolean is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_null_is_not_an_array_fails + # null is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_object_is_not_an_array_fails + # an object is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_string_is_not_an_array_fails + # a string is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_array_is_an_array_passes + # an array is an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_array_type_matches_arrays_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postArrayTypeMatchesArraysRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_an_array_fails + # an integer is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + + + def test_post_boolean_type_matches_booleans_request_body(self): + """Test case for post_boolean_type_matches_booleans_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_boolean_type_matches_booleans_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_empty_string_is_not_a_boolean_fails + # an empty string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_float_is_not_a_boolean_fails + # a float is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_null_is_not_a_boolean_fails + # null is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_zero_is_not_a_boolean_fails + # zero is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_an_array_is_not_a_boolean_fails + # an array is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_string_is_not_a_boolean_fails + # a string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_false_is_a_boolean_passes + # false is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_a_boolean_fails + # an integer is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_true_is_a_boolean_passes + # true is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_object_is_not_a_boolean_fails + # an object is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + + + def test_post_by_int_request_body(self): + """Test case for post_by_int_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_by_int_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_int_by_int_fail_fails + # int by int fail + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 7 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 7, + _configuration=self._configuration + ) + self.api.post_by_int_request_body(body=body) + + # test_int_by_int_passes + # int by int + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_number_request_body(self): + """Test case for post_by_number_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_by_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_45_is_multiple_of15_passes + # 4.5 is multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_35_is_not_multiple_of15_fails + # 35 is not multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_by_number_request_body(body=body) + + # test_zero_is_multiple_of_anything_passes + # zero is multiple of anything + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_small_number_request_body(self): + """Test case for post_by_small_number_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_by_small_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_000751_is_not_multiple_of00001_fails + # 0.00751 is not multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.00751 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.00751, + _configuration=self._configuration + ) + self.api.post_by_small_number_request_body(body=body) + + # test_00075_is_multiple_of00001_passes + # 0.0075 is multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0075 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_small_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBySmallNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_date_time_format_request_body(self): + """Test case for post_date_time_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_date_time_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_email_format_request_body(self): + """Test case for post_email_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_email_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with0_does_not_match_false_request_body(self): + """Test case for post_enum_with0_does_not_match_false_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enum_with0_does_not_match_false_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_integer_zero_is_valid_passes + # integer zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_valid_passes + # float zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_invalid_fails + # false is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_enum_with0_does_not_match_false_request_body(body=body) + + + + def test_post_enum_with1_does_not_match_true_request_body(self): + """Test case for post_enum_with1_does_not_match_true_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enum_with1_does_not_match_true_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_true_is_invalid_fails + # true is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_enum_with1_does_not_match_true_request_body(body=body) + + # test_integer_one_is_valid_passes + # integer one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_one_is_valid_passes + # float one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with_escaped_characters_request_body(self): + """Test case for post_enum_with_escaped_characters_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enum_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_member2_is_valid_passes + # member 2 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\rbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_member1_is_valid_passes + # member 1 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\nbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_another_string_is_invalid_fails + # another string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_enum_with_escaped_characters_request_body(body=body) + + + + def test_post_enum_with_false_does_not_match0_request_body(self): + """Test case for post_enum_with_false_does_not_match0_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enum_with_false_does_not_match0_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_false_is_valid_passes + # false is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_false_does_not_match0_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_invalid_fails + # float zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + # test_integer_zero_is_invalid_fails + # integer zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + + + def test_post_enum_with_true_does_not_match1_request_body(self): + """Test case for post_enum_with_true_does_not_match1_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enum_with_true_does_not_match1_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_float_one_is_invalid_fails + # float one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + # test_true_is_valid_passes + # true is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_true_does_not_match1_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_integer_one_is_invalid_fails + # integer one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + + + def test_post_enums_in_properties_request_body(self): + """Test case for post_enums_in_properties_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_enums_in_properties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_optional_property_is_valid_passes + # missing optional property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_foo_value_fails + # wrong foo value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foot", + "bar": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foot", + "bar": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_both_properties_are_valid_passes + # both properties are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_bar_value_fails + # wrong bar value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bart", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + "bar": + "bart", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_all_properties_is_invalid_fails + # missing all properties is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_required_property_is_invalid_fails + # missing required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + + + def test_post_forbidden_property_request_body(self): + """Test case for post_forbidden_property_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_forbidden_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_present_fails + # property present + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_forbidden_property_request_body(body=body) + + # test_property_absent_passes + # property absent + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + "baz": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_forbidden_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postForbiddenPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_hostname_format_request_body(self): + """Test case for post_hostname_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_hostname_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_integer_type_matches_integers_request_body(self): + """Test case for post_integer_type_matches_integers_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_integer_type_matches_integers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_object_is_not_an_integer_fails + # an object is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_string_is_not_an_integer_fails + # a string is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_null_is_not_an_integer_fails + # null is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_float_with_zero_fractional_part_is_an_integer_passes + # a float with zero fractional part is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_an_integer_fails + # a float is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_boolean_is_not_an_integer_fails + # a boolean is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_integer_is_an_integer_passes + # an integer is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails + # a string is still not an integer, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_array_is_not_an_integer_fails + # an array is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + + + def test_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(self): + """Test case for post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails + # always invalid, but naive implementations may raise an overflow error + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0E308 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0E308, + _configuration=self._configuration + ) + self.api.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body=body) + + + + def test_post_invalid_string_value_for_default_request_body(self): + """Test case for post_invalid_string_value_for_default_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_invalid_string_value_for_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_when_property_is_specified_passes + # valid when property is specified + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "good", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_still_valid_when_the_invalid_default_is_used_passes + # still valid when the invalid default is used + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv4_format_request_body(self): + """Test case for post_ipv4_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ipv4_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv6_format_request_body(self): + """Test case for post_ipv6_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ipv6_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_json_pointer_format_request_body(self): + """Test case for post_json_pointer_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_json_pointer_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_request_body(self): + """Test case for post_maximum_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maximum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_valid_passes + # below the maximum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_request_body(body=body) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_with_unsigned_integer_request_body(self): + """Test case for post_maximum_validation_with_unsigned_integer_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maximum_validation_with_unsigned_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_invalid_passes + # below the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 299.97 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 300.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_with_unsigned_integer_request_body(body=body) + + # test_boundary_point_integer_is_valid_passes + # boundary point integer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_float_is_valid_passes + # boundary point float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxitems_validation_request_body(self): + """Test case for post_maxitems_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maxitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 3, + ], + _configuration=self._configuration + ) + self.api.post_maxitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxlength_validation_request_body(self): + """Test case for post_maxlength_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maxlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_maxlength_validation_request_body(body=body) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 100 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_two_supplementary_unicode_code_points_is_long_enough_passes + # two supplementary Unicode code points is long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩💩" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxproperties0_means_the_object_is_empty_request_body(self): + """Test case for post_maxproperties0_means_the_object_is_empty_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maxproperties0_means_the_object_is_empty_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_properties_is_valid_passes + # no properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_is_invalid_fails + # one property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties0_means_the_object_is_empty_request_body(body=body) + + + + def test_post_maxproperties_validation_request_body(self): + """Test case for post_maxproperties_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_maxproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties_validation_request_body(body=body) + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_request_body(self): + """Test case for post_minimum_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_minimum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_below_the_minimum_is_invalid_fails + # below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.6, + _configuration=self._configuration + ) + self.api.post_minimum_validation_request_body(body=body) + + # test_above_the_minimum_is_valid_passes + # above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_with_signed_integer_request_body(self): + """Test case for post_minimum_validation_with_signed_integer_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_minimum_validation_with_signed_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_positive_above_the_minimum_is_valid_passes + # positive above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_int_below_the_minimum_is_invalid_fails + # int below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -3, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_float_below_the_minimum_is_invalid_fails + # float below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0001 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -2.0001, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_boundary_point_with_float_is_valid_passes + # boundary point with float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_negative_above_the_minimum_is_valid_passes + # negative above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minitems_validation_request_body(self): + """Test case for post_minitems_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_minitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_minitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minlength_validation_request_body(self): + """Test case for post_minlength_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_minlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "f", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_one_supplementary_unicode_code_point_is_not_long_enough_fails + # one supplementary Unicode code point is not long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "💩", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minproperties_validation_request_body(self): + """Test case for post_minproperties_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_minproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_minproperties_validation_request_body(body=body) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_allof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_allof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_nested_allof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_allof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_anyof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_anyof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_nested_anyof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_anyof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_items_request_body(self): + """Test case for post_nested_items_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_nested_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_nested_array_passes + # valid nested array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + 1, + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_nested_array_with_invalid_type_fails + # nested array with invalid type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + # test_not_deep_enough_fails + # not deep enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + + + def test_post_nested_oneof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_oneof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_nested_oneof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_oneof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_more_complex_schema_request_body(self): + """Test case for post_not_more_complex_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_not_more_complex_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_other_match_passes + # other match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_fails + # mismatch + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_not_more_complex_schema_request_body(body=body) + + # test_match_passes + # match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_request_body(self): + """Test case for post_not_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_not_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allowed_passes + # allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_disallowed_fails + # disallowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_not_request_body(body=body) + + + + def test_post_nul_characters_in_strings_request_body(self): + """Test case for post_nul_characters_in_strings_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_nul_characters_in_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_match_string_with_nul_passes + # match string with nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hello\x00there" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nul_characters_in_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNulCharactersInStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_do_not_match_string_lacking_nul_fails + # do not match string lacking nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hellothere" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "hellothere", + _configuration=self._configuration + ) + self.api.post_nul_characters_in_strings_request_body(body=body) + + + + def test_post_null_type_matches_only_the_null_object_request_body(self): + """Test case for post_null_type_matches_only_the_null_object_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_null_type_matches_only_the_null_object_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_null_fails + # a float is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_object_is_not_null_fails + # an object is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_false_is_not_null_fails + # false is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_integer_is_not_null_fails + # an integer is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_true_is_not_null_fails + # true is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_zero_is_not_null_fails + # zero is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_empty_string_is_not_null_fails + # an empty string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_null_is_null_passes + # null is null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_null_type_matches_only_the_null_object_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_array_is_not_null_fails + # an array is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_a_string_is_not_null_fails + # a string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + + + def test_post_number_type_matches_numbers_request_body(self): + """Test case for post_number_type_matches_numbers_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_number_type_matches_numbers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_array_is_not_a_number_fails + # an array is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_null_is_not_a_number_fails + # null is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_object_is_not_a_number_fails + # an object is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_boolean_is_not_a_number_fails + # a boolean is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_float_is_a_number_passes + # a float is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails + # a string is still not a number, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_string_is_not_a_number_fails + # a string is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_integer_is_a_number_passes + # an integer is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes + # a float with zero fractional part is a number (and an integer) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_object_properties_validation_request_body(self): + """Test case for post_object_properties_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_object_properties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_invalid_is_invalid_fails + # one property invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + # test_both_properties_present_and_valid_is_valid_passes + # both properties present and valid is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_doesn_t_invalidate_other_properties_passes + # doesn't invalidate other properties + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "quux": + [ + ], + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_properties_invalid_is_invalid_fails + # both properties invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + [ + ], + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + [ + ], + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + + + def test_post_object_type_matches_objects_request_body(self): + """Test case for post_object_type_matches_objects_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_object_type_matches_objects_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_object_fails + # a float is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_null_is_not_an_object_fails + # null is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_array_is_not_an_object_fails + # an array is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_object_is_an_object_passes + # an object is an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_type_matches_objects_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectTypeMatchesObjectsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_not_an_object_fails + # a string is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_integer_is_not_an_object_fails + # an integer is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_a_boolean_is_not_an_object_fails + # a boolean is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + + + def test_post_oneof_complex_types_request_body(self): + """Test case for post_oneof_complex_types_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_oneof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_first_oneof_valid_complex_passes + # first oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_complex_fails + # neither oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_both_oneof_valid_complex_fails + # both oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_second_oneof_valid_complex_passes + # second oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_request_body(self): + """Test case for post_oneof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_oneof_valid_passes + # second oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + # test_first_oneof_valid_passes + # first oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_fails + # neither oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + + + def test_post_oneof_with_base_schema_request_body(self): + """Test case for post_oneof_with_base_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_oneof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_one_oneof_valid_passes + # one oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_with_empty_schema_request_body(self): + """Test case for post_oneof_with_empty_schema_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_oneof_with_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_valid_invalid_fails + # both valid - invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_oneof_with_empty_schema_request_body(body=body) + + # test_one_valid_valid_passes + # one valid - valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_is_not_anchored_request_body(self): + """Test case for post_pattern_is_not_anchored_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_pattern_is_not_anchored_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_matches_a_substring_passes + # matches a substring + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "xxaayy" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_is_not_anchored_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternIsNotAnchoredRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_validation_request_body(self): + """Test case for post_pattern_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_pattern_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_objects_passes + # ignores objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_null_passes + # ignores null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_floats_passes + # ignores floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_non_matching_pattern_is_invalid_fails + # a non-matching pattern is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_pattern_validation_request_body(body=body) + + # test_ignores_booleans_passes + # ignores booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_matching_pattern_is_valid_passes + # a matching pattern is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "aaa" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_integers_passes + # ignores integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_properties_with_escaped_characters_request_body(self): + """Test case for post_properties_with_escaped_characters_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_properties_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_object_with_all_numbers_is_valid_passes + # object with all numbers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + 1, + "foo\"bar": + 1, + "foo\\bar": + 1, + "foo\rbar": + 1, + "foo\tbar": + 1, + "foo\fbar": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_properties_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertiesWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_object_with_strings_is_invalid_fails + # object with strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + }, + _configuration=self._configuration + ) + self.api.post_properties_with_escaped_characters_request_body(body=body) + + + + def test_post_property_named_ref_that_is_not_a_reference_request_body(self): + """Test case for post_property_named_ref_that_is_not_a_reference_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_property_named_ref_that_is_not_a_reference_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_property_named_ref_that_is_not_a_reference_request_body(body=body) + + + + def test_post_ref_in_additionalproperties_request_body(self): + """Test case for post_ref_in_additionalproperties_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_additionalproperties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_additionalproperties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAdditionalpropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "someProp": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_additionalproperties_request_body(body=body) + + + + def test_post_ref_in_allof_request_body(self): + """Test case for post_ref_in_allof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_allof_request_body(body=body) + + + + def test_post_ref_in_anyof_request_body(self): + """Test case for post_ref_in_anyof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_anyof_request_body(body=body) + + + + def test_post_ref_in_items_request_body(self): + """Test case for post_ref_in_items_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + "a", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + 2, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "$ref": + 2, + }, + ], + _configuration=self._configuration + ) + self.api.post_ref_in_items_request_body(body=body) + + + + def test_post_ref_in_oneof_request_body(self): + """Test case for post_ref_in_oneof_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_oneof_request_body(body=body) + + + + def test_post_ref_in_property_request_body(self): + """Test case for post_ref_in_property_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_ref_in_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "a": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_property_request_body(body=body) + + + + def test_post_required_default_validation_request_body(self): + """Test case for post_required_default_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_required_default_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_not_required_by_default_passes + # not required by default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_default_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredDefaultValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_required_validation_request_body(self): + """Test case for post_required_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_required_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_present_required_property_is_valid_passes + # present required property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_present_required_property_is_invalid_fails + # non-present required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 1, + }, + _configuration=self._configuration + ) + self.api.post_required_validation_request_body(body=body) + + + + def test_post_required_with_empty_array_request_body(self): + """Test case for post_required_with_empty_array_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_required_with_empty_array_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_not_required_passes + # property not required + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_with_empty_array_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredWithEmptyArrayRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_simple_enum_validation_request_body(self): + """Test case for post_simple_enum_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_simple_enum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_something_else_is_invalid_fails + # something else is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 4, + _configuration=self._configuration + ) + self.api.post_simple_enum_validation_request_body(body=body) + + # test_one_of_the_enum_is_valid_passes + # one of the enum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_simple_enum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postSimpleEnumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_string_type_matches_strings_request_body(self): + """Test case for post_string_type_matches_strings_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_string_type_matches_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_1_is_not_a_string_fails + # 1 is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes + # a string is still a string, even if it looks like a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_empty_string_is_still_a_string_passes + # an empty string is still a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_a_string_fails + # a float is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_object_is_not_a_string_fails + # an object is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_array_is_not_a_string_fails + # an array is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_boolean_is_not_a_string_fails + # a boolean is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_null_is_not_a_string_fails + # null is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_a_string_passes + # a string is a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(self): + """Test case for post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_properties_are_not_filled_in_with_the_default_passes + # missing properties are not filled in with the default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_passing_passes + # an explicit property value is checked against maximum (passing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_failing_fails + # an explicit property value is checked against maximum (failing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 5, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "alpha": + 5, + }, + _configuration=self._configuration + ) + self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(body=body) + + + + def test_post_uniqueitems_false_validation_request_body(self): + """Test case for post_uniqueitems_false_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_uniqueitems_false_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_non_unique_array_of_integers_is_valid_passes + # non-unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_valid_passes + # non-unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_objects_is_valid_passes + # non-unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # 1 and true are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_valid_passes + # non-unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_passes + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # 0 and false are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_valid_passes + # non-unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uniqueitems_validation_request_body(self): + """Test case for post_uniqueitems_validation_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_uniqueitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_true_and_a1_are_unique_passes + # {"a": true} and {"a": 1} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + True, + }, + { + "a": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_invalid_fails + # non-unique heterogeneous types are invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested0_and_false_are_unique_passes + # nested [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 0, + ], + "foo", + ], + [ + [ + False, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_false_and_a0_are_unique_passes + # {"a": false} and {"a": 0} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + False, + }, + { + "a": + 0, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_fails + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1.0, + 1.0, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 0, + ], + [ + False, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_invalid_fails + # non-unique array of nested objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_more_than_two_integers_is_invalid_fails + # non-unique array of more than two integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_objects_are_non_unique_despite_key_order_fails + # objects are non-unique despite key order + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_strings_is_valid_passes + # unique array of strings is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "baz", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 1, + ], + [ + True, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_different_objects_are_unique_passes + # different objects are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "a": + 2, + "b": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_more_than_two_arrays_is_invalid_fails + # non-unique array of more than two arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_objects_is_invalid_fails + # non-unique array of objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_invalid_fails + # non-unique array of arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_strings_is_invalid_fails + # non-unique array of strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "foo", + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + "foo", + "bar", + "foo", + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested1_and_true_are_unique_passes + # nested [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + "foo", + ], + [ + [ + True, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + "{}", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_integers_is_invalid_fails + # non-unique array of integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + + + def test_post_uri_format_request_body(self): + """Test case for post_uri_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_uri_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_reference_format_request_body(self): + """Test case for post_uri_reference_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_uri_reference_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_template_format_request_body(self): + """Test case for post_uri_template_format_request_body + + """ + from unit_test_api.api.json_api_endpoints import post_uri_template_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_post_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_post_api.py new file mode 100644 index 00000000000..7fca42c6ff0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_post_api.py @@ -0,0 +1,10585 @@ +# 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 unittest +from unittest.mock import patch + +import urllib3 + +import unit_test_api +from unit_test_api.api.post_api import PostApi # noqa: E501 +from unit_test_api import configuration, schemas, api_client + +from . import ApiTestMixin + + +class TestPostApi(ApiTestMixin, unittest.TestCase): + """PostApi unit test stubs""" + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = PostApi(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + def test_post_additionalproperties_allows_a_schema_which_should_validate_request_body(self): + """Test case for post_additionalproperties_allows_a_schema_which_should_validate_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_additionalproperties_allows_a_schema_which_should_validate_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_additional_properties_is_valid_passes + # no additional properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_are_allowed_by_default_request_body(self): + """Test case for post_additionalproperties_are_allowed_by_default_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_additionalproperties_are_allowed_by_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_additional_properties_are_allowed_passes + # additional properties are allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_can_exist_by_itself_request_body(self): + """Test case for post_additionalproperties_can_exist_by_itself_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_additionalproperties_can_exist_by_itself_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_can_exist_by_itself_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_should_not_look_in_applicators_request_body(self): + """Test case for post_additionalproperties_should_not_look_in_applicators_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_additionalproperties_should_not_look_in_applicators_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_properties_defined_in_allof_are_not_examined_fails + # properties defined in allOf are not examined + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + True, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + True, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_should_not_look_in_applicators_request_body(body=body) + + + + def test_post_allof_combined_with_anyof_oneof_request_body(self): + """Test case for post_allof_combined_with_anyof_oneof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_combined_with_anyof_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_true_anyof_false_oneof_false_fails + # allOf: true, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 2, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_true_fails + # allOf: false, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 5, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_true_fails + # allOf: false, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 15 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 15, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_false_fails + # allOf: true, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 6, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_true_passes + # allOf: true, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 30 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_combined_with_anyof_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofCombinedWithAnyofOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_allof_true_anyof_false_oneof_true_fails + # allOf: true, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 10, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_false_fails + # allOf: false, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_false_fails + # allOf: false, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + + + def test_post_allof_request_body(self): + """Test case for post_allof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_passes + # allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_fails + # mismatch first + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_mismatch_second_fails + # mismatch second + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_wrong_type_fails + # wrong type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + + + def test_post_allof_simple_types_request_body(self): + """Test case for post_allof_simple_types_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_simple_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 25 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_simple_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofSimpleTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_one_fails + # mismatch one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_allof_simple_types_request_body(body=body) + + + + def test_post_allof_with_base_schema_request_body(self): + """Test case for post_allof_with_base_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + "baz": + None, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_allof_fails + # mismatch first allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_both_fails + # mismatch both + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_second_allof_fails + # mismatch second allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + + + def test_post_allof_with_one_empty_schema_request_body(self): + """Test case for post_allof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_first_empty_schema_request_body(self): + """Test case for post_allof_with_the_first_empty_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_with_the_first_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_first_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_first_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_last_empty_schema_request_body(self): + """Test case for post_allof_with_the_last_empty_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_with_the_last_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_last_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_last_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheLastEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_two_empty_schemas_request_body(self): + """Test case for post_allof_with_two_empty_schemas_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_allof_with_two_empty_schemas_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_two_empty_schemas_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTwoEmptySchemasRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_complex_types_request_body(self): + """Test case for post_anyof_complex_types_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_anyof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_complex_passes + # second anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_complex_fails + # neither anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_anyof_complex_types_request_body(body=body) + + # test_both_anyof_valid_complex_passes + # both anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_complex_passes + # first anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_request_body(self): + """Test case for post_anyof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_passes + # second anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_fails + # neither anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_anyof_request_body(body=body) + + # test_both_anyof_valid_passes + # both anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_passes + # first anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_with_base_schema_request_body(self): + """Test case for post_anyof_with_base_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_anyof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_one_anyof_valid_passes + # one anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_anyof_invalid_fails + # both anyOf invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + + + def test_post_anyof_with_one_empty_schema_request_body(self): + """Test case for post_anyof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_anyof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_valid_passes + # string is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_array_type_matches_arrays_request_body(self): + """Test case for post_array_type_matches_arrays_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_array_type_matches_arrays_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_array_fails + # a float is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_boolean_is_not_an_array_fails + # a boolean is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_null_is_not_an_array_fails + # null is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_object_is_not_an_array_fails + # an object is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_string_is_not_an_array_fails + # a string is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_array_is_an_array_passes + # an array is an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_array_type_matches_arrays_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postArrayTypeMatchesArraysRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_an_array_fails + # an integer is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + + + def test_post_boolean_type_matches_booleans_request_body(self): + """Test case for post_boolean_type_matches_booleans_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_boolean_type_matches_booleans_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_empty_string_is_not_a_boolean_fails + # an empty string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_float_is_not_a_boolean_fails + # a float is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_null_is_not_a_boolean_fails + # null is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_zero_is_not_a_boolean_fails + # zero is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_an_array_is_not_a_boolean_fails + # an array is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_string_is_not_a_boolean_fails + # a string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_false_is_a_boolean_passes + # false is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_a_boolean_fails + # an integer is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_true_is_a_boolean_passes + # true is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_object_is_not_a_boolean_fails + # an object is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + + + def test_post_by_int_request_body(self): + """Test case for post_by_int_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_by_int_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_int_by_int_fail_fails + # int by int fail + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 7 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 7, + _configuration=self._configuration + ) + self.api.post_by_int_request_body(body=body) + + # test_int_by_int_passes + # int by int + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_number_request_body(self): + """Test case for post_by_number_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_by_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_45_is_multiple_of15_passes + # 4.5 is multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_35_is_not_multiple_of15_fails + # 35 is not multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_by_number_request_body(body=body) + + # test_zero_is_multiple_of_anything_passes + # zero is multiple of anything + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_small_number_request_body(self): + """Test case for post_by_small_number_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_by_small_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_000751_is_not_multiple_of00001_fails + # 0.00751 is not multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.00751 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.00751, + _configuration=self._configuration + ) + self.api.post_by_small_number_request_body(body=body) + + # test_00075_is_multiple_of00001_passes + # 0.0075 is multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0075 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_small_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBySmallNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_date_time_format_request_body(self): + """Test case for post_date_time_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_date_time_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_email_format_request_body(self): + """Test case for post_email_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_email_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with0_does_not_match_false_request_body(self): + """Test case for post_enum_with0_does_not_match_false_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enum_with0_does_not_match_false_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_integer_zero_is_valid_passes + # integer zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_valid_passes + # float zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_invalid_fails + # false is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_enum_with0_does_not_match_false_request_body(body=body) + + + + def test_post_enum_with1_does_not_match_true_request_body(self): + """Test case for post_enum_with1_does_not_match_true_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enum_with1_does_not_match_true_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_true_is_invalid_fails + # true is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_enum_with1_does_not_match_true_request_body(body=body) + + # test_integer_one_is_valid_passes + # integer one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_one_is_valid_passes + # float one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with_escaped_characters_request_body(self): + """Test case for post_enum_with_escaped_characters_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enum_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_member2_is_valid_passes + # member 2 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\rbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_member1_is_valid_passes + # member 1 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\nbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_another_string_is_invalid_fails + # another string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_enum_with_escaped_characters_request_body(body=body) + + + + def test_post_enum_with_false_does_not_match0_request_body(self): + """Test case for post_enum_with_false_does_not_match0_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enum_with_false_does_not_match0_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_false_is_valid_passes + # false is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_false_does_not_match0_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_invalid_fails + # float zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + # test_integer_zero_is_invalid_fails + # integer zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + + + def test_post_enum_with_true_does_not_match1_request_body(self): + """Test case for post_enum_with_true_does_not_match1_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enum_with_true_does_not_match1_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_float_one_is_invalid_fails + # float one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + # test_true_is_valid_passes + # true is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_true_does_not_match1_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_integer_one_is_invalid_fails + # integer one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + + + def test_post_enums_in_properties_request_body(self): + """Test case for post_enums_in_properties_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_enums_in_properties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_optional_property_is_valid_passes + # missing optional property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_foo_value_fails + # wrong foo value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foot", + "bar": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foot", + "bar": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_both_properties_are_valid_passes + # both properties are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_bar_value_fails + # wrong bar value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bart", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + "bar": + "bart", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_all_properties_is_invalid_fails + # missing all properties is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_required_property_is_invalid_fails + # missing required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + + + def test_post_forbidden_property_request_body(self): + """Test case for post_forbidden_property_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_forbidden_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_present_fails + # property present + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_forbidden_property_request_body(body=body) + + # test_property_absent_passes + # property absent + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + "baz": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_forbidden_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postForbiddenPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_hostname_format_request_body(self): + """Test case for post_hostname_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_hostname_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_integer_type_matches_integers_request_body(self): + """Test case for post_integer_type_matches_integers_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_integer_type_matches_integers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_object_is_not_an_integer_fails + # an object is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_string_is_not_an_integer_fails + # a string is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_null_is_not_an_integer_fails + # null is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_float_with_zero_fractional_part_is_an_integer_passes + # a float with zero fractional part is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_an_integer_fails + # a float is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_boolean_is_not_an_integer_fails + # a boolean is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_integer_is_an_integer_passes + # an integer is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails + # a string is still not an integer, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_array_is_not_an_integer_fails + # an array is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + + + def test_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(self): + """Test case for post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails + # always invalid, but naive implementations may raise an overflow error + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0E308 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0E308, + _configuration=self._configuration + ) + self.api.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body=body) + + + + def test_post_invalid_string_value_for_default_request_body(self): + """Test case for post_invalid_string_value_for_default_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_invalid_string_value_for_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_when_property_is_specified_passes + # valid when property is specified + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "good", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_still_valid_when_the_invalid_default_is_used_passes + # still valid when the invalid default is used + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv4_format_request_body(self): + """Test case for post_ipv4_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ipv4_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv6_format_request_body(self): + """Test case for post_ipv6_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ipv6_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_json_pointer_format_request_body(self): + """Test case for post_json_pointer_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_json_pointer_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_request_body(self): + """Test case for post_maximum_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maximum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_valid_passes + # below the maximum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_request_body(body=body) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_with_unsigned_integer_request_body(self): + """Test case for post_maximum_validation_with_unsigned_integer_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maximum_validation_with_unsigned_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_invalid_passes + # below the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 299.97 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 300.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_with_unsigned_integer_request_body(body=body) + + # test_boundary_point_integer_is_valid_passes + # boundary point integer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_float_is_valid_passes + # boundary point float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxitems_validation_request_body(self): + """Test case for post_maxitems_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maxitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 3, + ], + _configuration=self._configuration + ) + self.api.post_maxitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxlength_validation_request_body(self): + """Test case for post_maxlength_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maxlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_maxlength_validation_request_body(body=body) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 100 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_two_supplementary_unicode_code_points_is_long_enough_passes + # two supplementary Unicode code points is long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩💩" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxproperties0_means_the_object_is_empty_request_body(self): + """Test case for post_maxproperties0_means_the_object_is_empty_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maxproperties0_means_the_object_is_empty_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_properties_is_valid_passes + # no properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_is_invalid_fails + # one property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties0_means_the_object_is_empty_request_body(body=body) + + + + def test_post_maxproperties_validation_request_body(self): + """Test case for post_maxproperties_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_maxproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties_validation_request_body(body=body) + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_request_body(self): + """Test case for post_minimum_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_minimum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_below_the_minimum_is_invalid_fails + # below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.6, + _configuration=self._configuration + ) + self.api.post_minimum_validation_request_body(body=body) + + # test_above_the_minimum_is_valid_passes + # above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_with_signed_integer_request_body(self): + """Test case for post_minimum_validation_with_signed_integer_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_minimum_validation_with_signed_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_positive_above_the_minimum_is_valid_passes + # positive above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_int_below_the_minimum_is_invalid_fails + # int below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -3, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_float_below_the_minimum_is_invalid_fails + # float below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0001 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -2.0001, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_boundary_point_with_float_is_valid_passes + # boundary point with float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_negative_above_the_minimum_is_valid_passes + # negative above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minitems_validation_request_body(self): + """Test case for post_minitems_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_minitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_minitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minlength_validation_request_body(self): + """Test case for post_minlength_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_minlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "f", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_one_supplementary_unicode_code_point_is_not_long_enough_fails + # one supplementary Unicode code point is not long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "💩", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minproperties_validation_request_body(self): + """Test case for post_minproperties_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_minproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_minproperties_validation_request_body(body=body) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_allof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_allof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_nested_allof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_allof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_anyof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_anyof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_nested_anyof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_anyof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_items_request_body(self): + """Test case for post_nested_items_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_nested_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_nested_array_passes + # valid nested array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + 1, + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_nested_array_with_invalid_type_fails + # nested array with invalid type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + # test_not_deep_enough_fails + # not deep enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + + + def test_post_nested_oneof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_oneof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_nested_oneof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_oneof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_more_complex_schema_request_body(self): + """Test case for post_not_more_complex_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_not_more_complex_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_other_match_passes + # other match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_fails + # mismatch + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_not_more_complex_schema_request_body(body=body) + + # test_match_passes + # match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_request_body(self): + """Test case for post_not_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_not_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allowed_passes + # allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_disallowed_fails + # disallowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_not_request_body(body=body) + + + + def test_post_nul_characters_in_strings_request_body(self): + """Test case for post_nul_characters_in_strings_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_nul_characters_in_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_match_string_with_nul_passes + # match string with nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hello\x00there" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nul_characters_in_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNulCharactersInStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_do_not_match_string_lacking_nul_fails + # do not match string lacking nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hellothere" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "hellothere", + _configuration=self._configuration + ) + self.api.post_nul_characters_in_strings_request_body(body=body) + + + + def test_post_null_type_matches_only_the_null_object_request_body(self): + """Test case for post_null_type_matches_only_the_null_object_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_null_type_matches_only_the_null_object_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_null_fails + # a float is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_object_is_not_null_fails + # an object is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_false_is_not_null_fails + # false is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_integer_is_not_null_fails + # an integer is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_true_is_not_null_fails + # true is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_zero_is_not_null_fails + # zero is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_empty_string_is_not_null_fails + # an empty string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_null_is_null_passes + # null is null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_null_type_matches_only_the_null_object_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_array_is_not_null_fails + # an array is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_a_string_is_not_null_fails + # a string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + + + def test_post_number_type_matches_numbers_request_body(self): + """Test case for post_number_type_matches_numbers_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_number_type_matches_numbers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_array_is_not_a_number_fails + # an array is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_null_is_not_a_number_fails + # null is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_object_is_not_a_number_fails + # an object is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_boolean_is_not_a_number_fails + # a boolean is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_float_is_a_number_passes + # a float is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails + # a string is still not a number, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_string_is_not_a_number_fails + # a string is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_integer_is_a_number_passes + # an integer is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes + # a float with zero fractional part is a number (and an integer) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_object_properties_validation_request_body(self): + """Test case for post_object_properties_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_object_properties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_invalid_is_invalid_fails + # one property invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + # test_both_properties_present_and_valid_is_valid_passes + # both properties present and valid is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_doesn_t_invalidate_other_properties_passes + # doesn't invalidate other properties + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "quux": + [ + ], + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_properties_invalid_is_invalid_fails + # both properties invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + [ + ], + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + [ + ], + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + + + def test_post_object_type_matches_objects_request_body(self): + """Test case for post_object_type_matches_objects_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_object_type_matches_objects_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_object_fails + # a float is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_null_is_not_an_object_fails + # null is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_array_is_not_an_object_fails + # an array is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_object_is_an_object_passes + # an object is an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_type_matches_objects_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectTypeMatchesObjectsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_not_an_object_fails + # a string is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_integer_is_not_an_object_fails + # an integer is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_a_boolean_is_not_an_object_fails + # a boolean is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + + + def test_post_oneof_complex_types_request_body(self): + """Test case for post_oneof_complex_types_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_oneof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_first_oneof_valid_complex_passes + # first oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_complex_fails + # neither oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_both_oneof_valid_complex_fails + # both oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_second_oneof_valid_complex_passes + # second oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_request_body(self): + """Test case for post_oneof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_oneof_valid_passes + # second oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + # test_first_oneof_valid_passes + # first oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_fails + # neither oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + + + def test_post_oneof_with_base_schema_request_body(self): + """Test case for post_oneof_with_base_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_oneof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_one_oneof_valid_passes + # one oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_with_empty_schema_request_body(self): + """Test case for post_oneof_with_empty_schema_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_oneof_with_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_valid_invalid_fails + # both valid - invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_oneof_with_empty_schema_request_body(body=body) + + # test_one_valid_valid_passes + # one valid - valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_is_not_anchored_request_body(self): + """Test case for post_pattern_is_not_anchored_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_pattern_is_not_anchored_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_matches_a_substring_passes + # matches a substring + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "xxaayy" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_is_not_anchored_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternIsNotAnchoredRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_validation_request_body(self): + """Test case for post_pattern_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_pattern_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_objects_passes + # ignores objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_null_passes + # ignores null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_floats_passes + # ignores floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_non_matching_pattern_is_invalid_fails + # a non-matching pattern is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_pattern_validation_request_body(body=body) + + # test_ignores_booleans_passes + # ignores booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_matching_pattern_is_valid_passes + # a matching pattern is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "aaa" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_integers_passes + # ignores integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_properties_with_escaped_characters_request_body(self): + """Test case for post_properties_with_escaped_characters_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_properties_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_object_with_all_numbers_is_valid_passes + # object with all numbers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + 1, + "foo\"bar": + 1, + "foo\\bar": + 1, + "foo\rbar": + 1, + "foo\tbar": + 1, + "foo\fbar": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_properties_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertiesWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_object_with_strings_is_invalid_fails + # object with strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + }, + _configuration=self._configuration + ) + self.api.post_properties_with_escaped_characters_request_body(body=body) + + + + def test_post_property_named_ref_that_is_not_a_reference_request_body(self): + """Test case for post_property_named_ref_that_is_not_a_reference_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_property_named_ref_that_is_not_a_reference_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_property_named_ref_that_is_not_a_reference_request_body(body=body) + + + + def test_post_ref_in_additionalproperties_request_body(self): + """Test case for post_ref_in_additionalproperties_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_additionalproperties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_additionalproperties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAdditionalpropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "someProp": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_additionalproperties_request_body(body=body) + + + + def test_post_ref_in_allof_request_body(self): + """Test case for post_ref_in_allof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_allof_request_body(body=body) + + + + def test_post_ref_in_anyof_request_body(self): + """Test case for post_ref_in_anyof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_anyof_request_body(body=body) + + + + def test_post_ref_in_items_request_body(self): + """Test case for post_ref_in_items_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + "a", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + 2, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "$ref": + 2, + }, + ], + _configuration=self._configuration + ) + self.api.post_ref_in_items_request_body(body=body) + + + + def test_post_ref_in_oneof_request_body(self): + """Test case for post_ref_in_oneof_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_oneof_request_body(body=body) + + + + def test_post_ref_in_property_request_body(self): + """Test case for post_ref_in_property_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_ref_in_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "a": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_property_request_body(body=body) + + + + def test_post_required_default_validation_request_body(self): + """Test case for post_required_default_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_required_default_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_not_required_by_default_passes + # not required by default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_default_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredDefaultValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_required_validation_request_body(self): + """Test case for post_required_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_required_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_present_required_property_is_valid_passes + # present required property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_present_required_property_is_invalid_fails + # non-present required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 1, + }, + _configuration=self._configuration + ) + self.api.post_required_validation_request_body(body=body) + + + + def test_post_required_with_empty_array_request_body(self): + """Test case for post_required_with_empty_array_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_required_with_empty_array_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_not_required_passes + # property not required + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_with_empty_array_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredWithEmptyArrayRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_simple_enum_validation_request_body(self): + """Test case for post_simple_enum_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_simple_enum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_something_else_is_invalid_fails + # something else is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 4, + _configuration=self._configuration + ) + self.api.post_simple_enum_validation_request_body(body=body) + + # test_one_of_the_enum_is_valid_passes + # one of the enum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_simple_enum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postSimpleEnumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_string_type_matches_strings_request_body(self): + """Test case for post_string_type_matches_strings_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_string_type_matches_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_1_is_not_a_string_fails + # 1 is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes + # a string is still a string, even if it looks like a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_empty_string_is_still_a_string_passes + # an empty string is still a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_a_string_fails + # a float is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_object_is_not_a_string_fails + # an object is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_array_is_not_a_string_fails + # an array is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_boolean_is_not_a_string_fails + # a boolean is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_null_is_not_a_string_fails + # null is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_a_string_passes + # a string is a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(self): + """Test case for post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_properties_are_not_filled_in_with_the_default_passes + # missing properties are not filled in with the default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_passing_passes + # an explicit property value is checked against maximum (passing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_failing_fails + # an explicit property value is checked against maximum (failing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 5, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "alpha": + 5, + }, + _configuration=self._configuration + ) + self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(body=body) + + + + def test_post_uniqueitems_false_validation_request_body(self): + """Test case for post_uniqueitems_false_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_uniqueitems_false_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_non_unique_array_of_integers_is_valid_passes + # non-unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_valid_passes + # non-unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_objects_is_valid_passes + # non-unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # 1 and true are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_valid_passes + # non-unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_passes + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # 0 and false are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_valid_passes + # non-unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uniqueitems_validation_request_body(self): + """Test case for post_uniqueitems_validation_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_uniqueitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_true_and_a1_are_unique_passes + # {"a": true} and {"a": 1} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + True, + }, + { + "a": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_invalid_fails + # non-unique heterogeneous types are invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested0_and_false_are_unique_passes + # nested [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 0, + ], + "foo", + ], + [ + [ + False, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_false_and_a0_are_unique_passes + # {"a": false} and {"a": 0} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + False, + }, + { + "a": + 0, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_fails + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1.0, + 1.0, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 0, + ], + [ + False, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_invalid_fails + # non-unique array of nested objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_more_than_two_integers_is_invalid_fails + # non-unique array of more than two integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_objects_are_non_unique_despite_key_order_fails + # objects are non-unique despite key order + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_strings_is_valid_passes + # unique array of strings is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "baz", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 1, + ], + [ + True, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_different_objects_are_unique_passes + # different objects are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "a": + 2, + "b": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_more_than_two_arrays_is_invalid_fails + # non-unique array of more than two arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_objects_is_invalid_fails + # non-unique array of objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_invalid_fails + # non-unique array of arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_strings_is_invalid_fails + # non-unique array of strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "foo", + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + "foo", + "bar", + "foo", + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested1_and_true_are_unique_passes + # nested [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + "foo", + ], + [ + [ + True, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + "{}", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_integers_is_invalid_fails + # non-unique array of integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + + + def test_post_uri_format_request_body(self): + """Test case for post_uri_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_uri_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_reference_format_request_body(self): + """Test case for post_uri_reference_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_uri_reference_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_template_format_request_body(self): + """Test case for post_uri_template_format_request_body + + """ + from unit_test_api.api.post_api_endpoints import post_uri_template_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_request_body_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_request_body_api.py new file mode 100644 index 00000000000..ab14cbc10fe --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_request_body_api.py @@ -0,0 +1,10585 @@ +# 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 unittest +from unittest.mock import patch + +import urllib3 + +import unit_test_api +from unit_test_api.api.request_body_api import RequestBodyApi # noqa: E501 +from unit_test_api import configuration, schemas, api_client + +from . import ApiTestMixin + + +class TestRequestBodyApi(ApiTestMixin, unittest.TestCase): + """RequestBodyApi unit test stubs""" + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = RequestBodyApi(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + def test_post_additionalproperties_allows_a_schema_which_should_validate_request_body(self): + """Test case for post_additionalproperties_allows_a_schema_which_should_validate_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_additionalproperties_allows_a_schema_which_should_validate_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_additional_properties_is_valid_passes + # no additional properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "quux": + 12, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_allows_a_schema_which_should_validate_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_are_allowed_by_default_request_body(self): + """Test case for post_additionalproperties_are_allowed_by_default_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_additionalproperties_are_allowed_by_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_additional_properties_are_allowed_passes + # additional properties are allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "quux": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_are_allowed_by_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_can_exist_by_itself_request_body(self): + """Test case for post_additionalproperties_can_exist_by_itself_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_additionalproperties_can_exist_by_itself_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_additional_invalid_property_is_invalid_fails + # an additional invalid property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_can_exist_by_itself_request_body(body=body) + + # test_an_additional_valid_property_is_valid_passes + # an additional valid property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + True, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_additionalproperties_can_exist_by_itself_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_additionalproperties_should_not_look_in_applicators_request_body(self): + """Test case for post_additionalproperties_should_not_look_in_applicators_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_additionalproperties_should_not_look_in_applicators_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_properties_defined_in_allof_are_not_examined_fails + # properties defined in allOf are not examined + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + True, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + True, + }, + _configuration=self._configuration + ) + self.api.post_additionalproperties_should_not_look_in_applicators_request_body(body=body) + + + + def test_post_allof_combined_with_anyof_oneof_request_body(self): + """Test case for post_allof_combined_with_anyof_oneof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_combined_with_anyof_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_true_anyof_false_oneof_false_fails + # allOf: true, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 2, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_true_fails + # allOf: false, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 5, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_true_fails + # allOf: false, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 15 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 15, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_false_fails + # allOf: true, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 6, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_true_anyof_true_oneof_true_passes + # allOf: true, anyOf: true, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 30 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_combined_with_anyof_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofCombinedWithAnyofOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_allof_true_anyof_false_oneof_true_fails + # allOf: true, anyOf: false, oneOf: true + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 10, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_true_oneof_false_fails + # allOf: false, anyOf: true, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + # test_allof_false_anyof_false_oneof_false_fails + # allOf: false, anyOf: false, oneOf: false + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_allof_combined_with_anyof_oneof_request_body(body=body) + + + + def test_post_allof_request_body(self): + """Test case for post_allof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allof_passes + # allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_fails + # mismatch first + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_mismatch_second_fails + # mismatch second + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + # test_wrong_type_fails + # wrong type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_allof_request_body(body=body) + + + + def test_post_allof_simple_types_request_body(self): + """Test case for post_allof_simple_types_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_simple_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 25 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_simple_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofSimpleTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_one_fails + # mismatch one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_allof_simple_types_request_body(body=body) + + + + def test_post_allof_with_base_schema_request_body(self): + """Test case for post_allof_with_base_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_passes + # valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + "baz": + None, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_first_allof_fails + # mismatch first allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "baz": + None, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "baz": + None, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_both_fails + # mismatch both + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + # test_mismatch_second_allof_fails + # mismatch second allOf + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "quux", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "quux", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_allof_with_base_schema_request_body(body=body) + + + + def test_post_allof_with_one_empty_schema_request_body(self): + """Test case for post_allof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_first_empty_schema_request_body(self): + """Test case for post_allof_with_the_first_empty_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_with_the_first_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_first_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_first_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_the_last_empty_schema_request_body(self): + """Test case for post_allof_with_the_last_empty_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_with_the_last_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_invalid_fails + # string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_allof_with_the_last_empty_schema_request_body(body=body) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_the_last_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTheLastEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_allof_with_two_empty_schemas_request_body(self): + """Test case for post_allof_with_two_empty_schemas_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_allof_with_two_empty_schemas_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_any_data_is_valid_passes + # any data is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_allof_with_two_empty_schemas_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAllofWithTwoEmptySchemasRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_complex_types_request_body(self): + """Test case for post_anyof_complex_types_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_anyof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_complex_passes + # second anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_complex_fails + # neither anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_anyof_complex_types_request_body(body=body) + + # test_both_anyof_valid_complex_passes + # both anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_complex_passes + # first anyOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_request_body(self): + """Test case for post_anyof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_anyof_valid_passes + # second anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_anyof_valid_fails + # neither anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_anyof_request_body(body=body) + + # test_both_anyof_valid_passes + # both anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_first_anyof_valid_passes + # first anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_anyof_with_base_schema_request_body(self): + """Test case for post_anyof_with_base_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_anyof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_one_anyof_valid_passes + # one anyOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_anyof_invalid_fails + # both anyOf invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_anyof_with_base_schema_request_body(body=body) + + + + def test_post_anyof_with_one_empty_schema_request_body(self): + """Test case for post_anyof_with_one_empty_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_anyof_with_one_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_string_is_valid_passes + # string is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_number_is_valid_passes + # number is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_anyof_with_one_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postAnyofWithOneEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_array_type_matches_arrays_request_body(self): + """Test case for post_array_type_matches_arrays_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_array_type_matches_arrays_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_array_fails + # a float is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_boolean_is_not_an_array_fails + # a boolean is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_null_is_not_an_array_fails + # null is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_object_is_not_an_array_fails + # an object is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_a_string_is_not_an_array_fails + # a string is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + # test_an_array_is_an_array_passes + # an array is an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_array_type_matches_arrays_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postArrayTypeMatchesArraysRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_an_array_fails + # an integer is not an array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_array_type_matches_arrays_request_body(body=body) + + + + def test_post_boolean_type_matches_booleans_request_body(self): + """Test case for post_boolean_type_matches_booleans_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_boolean_type_matches_booleans_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_empty_string_is_not_a_boolean_fails + # an empty string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_float_is_not_a_boolean_fails + # a float is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_null_is_not_a_boolean_fails + # null is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_zero_is_not_a_boolean_fails + # zero is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_an_array_is_not_a_boolean_fails + # an array is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_a_string_is_not_a_boolean_fails + # a string is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_false_is_a_boolean_passes + # false is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_integer_is_not_a_boolean_fails + # an integer is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + # test_true_is_a_boolean_passes + # true is a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_boolean_type_matches_booleans_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBooleanTypeMatchesBooleansRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_object_is_not_a_boolean_fails + # an object is not a boolean + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_boolean_type_matches_booleans_request_body(body=body) + + + + def test_post_by_int_request_body(self): + """Test case for post_by_int_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_by_int_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_int_by_int_fail_fails + # int by int fail + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 7 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 7, + _configuration=self._configuration + ) + self.api.post_by_int_request_body(body=body) + + # test_int_by_int_passes + # int by int + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 10 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_int_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByIntRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_number_request_body(self): + """Test case for post_by_number_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_by_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_45_is_multiple_of15_passes + # 4.5 is multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_35_is_not_multiple_of15_fails + # 35 is not multiple of 1.5 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 35 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 35, + _configuration=self._configuration + ) + self.api.post_by_number_request_body(body=body) + + # test_zero_is_multiple_of_anything_passes + # zero is multiple of anything + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postByNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_by_small_number_request_body(self): + """Test case for post_by_small_number_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_by_small_number_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_000751_is_not_multiple_of00001_fails + # 0.00751 is not multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.00751 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.00751, + _configuration=self._configuration + ) + self.api.post_by_small_number_request_body(body=body) + + # test_00075_is_multiple_of00001_passes + # 0.0075 is multiple of 0.0001 + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0075 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_by_small_number_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postBySmallNumberRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_date_time_format_request_body(self): + """Test case for post_date_time_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_date_time_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_date_time_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postDateTimeFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_email_format_request_body(self): + """Test case for post_email_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_email_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_email_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEmailFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with0_does_not_match_false_request_body(self): + """Test case for post_enum_with0_does_not_match_false_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enum_with0_does_not_match_false_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_integer_zero_is_valid_passes + # integer zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_valid_passes + # float zero is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with0_does_not_match_false_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_invalid_fails + # false is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_enum_with0_does_not_match_false_request_body(body=body) + + + + def test_post_enum_with1_does_not_match_true_request_body(self): + """Test case for post_enum_with1_does_not_match_true_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enum_with1_does_not_match_true_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_true_is_invalid_fails + # true is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_enum_with1_does_not_match_true_request_body(body=body) + + # test_integer_one_is_valid_passes + # integer one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_one_is_valid_passes + # float one is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with1_does_not_match_true_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_enum_with_escaped_characters_request_body(self): + """Test case for post_enum_with_escaped_characters_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enum_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_member2_is_valid_passes + # member 2 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\rbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_member1_is_valid_passes + # member 1 is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo\nbar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_another_string_is_invalid_fails + # another string is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_enum_with_escaped_characters_request_body(body=body) + + + + def test_post_enum_with_false_does_not_match0_request_body(self): + """Test case for post_enum_with_false_does_not_match0_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enum_with_false_does_not_match0_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_false_is_valid_passes + # false is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_false_does_not_match0_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_float_zero_is_invalid_fails + # float zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + # test_integer_zero_is_invalid_fails + # integer zero is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_enum_with_false_does_not_match0_request_body(body=body) + + + + def test_post_enum_with_true_does_not_match1_request_body(self): + """Test case for post_enum_with_true_does_not_match1_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enum_with_true_does_not_match1_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_float_one_is_invalid_fails + # float one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + # test_true_is_valid_passes + # true is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enum_with_true_does_not_match1_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_integer_one_is_invalid_fails + # integer one is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_enum_with_true_does_not_match1_request_body(body=body) + + + + def test_post_enums_in_properties_request_body(self): + """Test case for post_enums_in_properties_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_enums_in_properties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_optional_property_is_valid_passes + # missing optional property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_foo_value_fails + # wrong foo value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foot", + "bar": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foot", + "bar": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_both_properties_are_valid_passes + # both properties are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bar", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_enums_in_properties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postEnumsInPropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_wrong_bar_value_fails + # wrong bar value + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + "bar": + "bart", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + "bar": + "bart", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_all_properties_is_invalid_fails + # missing all properties is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + # test_missing_required_property_is_invalid_fails + # missing required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "foo", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "foo", + }, + _configuration=self._configuration + ) + self.api.post_enums_in_properties_request_body(body=body) + + + + def test_post_forbidden_property_request_body(self): + """Test case for post_forbidden_property_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_forbidden_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_present_fails + # property present + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_forbidden_property_request_body(body=body) + + # test_property_absent_passes + # property absent + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + "baz": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_forbidden_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postForbiddenPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_hostname_format_request_body(self): + """Test case for post_hostname_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_hostname_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_hostname_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postHostnameFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_integer_type_matches_integers_request_body(self): + """Test case for post_integer_type_matches_integers_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_integer_type_matches_integers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_object_is_not_an_integer_fails + # an object is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_string_is_not_an_integer_fails + # a string is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_null_is_not_an_integer_fails + # null is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_float_with_zero_fractional_part_is_an_integer_passes + # a float with zero fractional part is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_an_integer_fails + # a float is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_a_boolean_is_not_an_integer_fails + # a boolean is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_integer_is_an_integer_passes + # an integer is an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_integer_type_matches_integers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIntegerTypeMatchesIntegersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails + # a string is still not an integer, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + # test_an_array_is_not_an_integer_fails + # an array is not an integer + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_integer_type_matches_integers_request_body(body=body) + + + + def test_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(self): + """Test case for post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails + # always invalid, but naive implementations may raise an overflow error + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0E308 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.0E308, + _configuration=self._configuration + ) + self.api.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body(body=body) + + + + def test_post_invalid_string_value_for_default_request_body(self): + """Test case for post_invalid_string_value_for_default_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_invalid_string_value_for_default_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_when_property_is_specified_passes + # valid when property is specified + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + "good", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_still_valid_when_the_invalid_default_is_used_passes + # still valid when the invalid default is used + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_invalid_string_value_for_default_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postInvalidStringValueForDefaultRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv4_format_request_body(self): + """Test case for post_ipv4_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ipv4_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv4_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv4FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_ipv6_format_request_body(self): + """Test case for post_ipv6_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ipv6_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ipv6_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postIpv6FormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_json_pointer_format_request_body(self): + """Test case for post_json_pointer_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_json_pointer_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_json_pointer_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postJsonPointerFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_request_body(self): + """Test case for post_maximum_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maximum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_valid_passes + # below the maximum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_request_body(body=body) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maximum_validation_with_unsigned_integer_request_body(self): + """Test case for post_maximum_validation_with_unsigned_integer_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maximum_validation_with_unsigned_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_below_the_maximum_is_invalid_passes + # below the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 299.97 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_above_the_maximum_is_invalid_fails + # above the maximum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 300.5, + _configuration=self._configuration + ) + self.api.post_maximum_validation_with_unsigned_integer_request_body(body=body) + + # test_boundary_point_integer_is_valid_passes + # boundary point integer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_boundary_point_float_is_valid_passes + # boundary point float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 300.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maximum_validation_with_unsigned_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxitems_validation_request_body(self): + """Test case for post_maxitems_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maxitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 3, + ], + _configuration=self._configuration + ) + self.api.post_maxitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxlength_validation_request_body(self): + """Test case for post_maxlength_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maxlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_maxlength_validation_request_body(body=body) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 100 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_two_supplementary_unicode_code_points_is_long_enough_passes + # two supplementary Unicode code points is long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩💩" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_maxproperties0_means_the_object_is_empty_request_body(self): + """Test case for post_maxproperties0_means_the_object_is_empty_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maxproperties0_means_the_object_is_empty_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_no_properties_is_valid_passes + # no properties is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties0_means_the_object_is_empty_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_is_invalid_fails + # one property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties0_means_the_object_is_empty_request_body(body=body) + + + + def test_post_maxproperties_validation_request_body(self): + """Test case for post_maxproperties_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_maxproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_long_is_invalid_fails + # too long is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + 2, + "baz": + 3, + }, + _configuration=self._configuration + ) + self.api.post_maxproperties_validation_request_body(body=body) + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 3, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_shorter_is_valid_passes + # shorter is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_maxproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMaxpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_request_body(self): + """Test case for post_minimum_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_minimum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_below_the_minimum_is_invalid_fails + # below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0.6 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0.6, + _configuration=self._configuration + ) + self.api.post_minimum_validation_request_body(body=body) + + # test_above_the_minimum_is_valid_passes + # above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.6 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minimum_validation_with_signed_integer_request_body(self): + """Test case for post_minimum_validation_with_signed_integer_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_minimum_validation_with_signed_integer_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_boundary_point_is_valid_passes + # boundary point is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_positive_above_the_minimum_is_valid_passes + # positive above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_int_below_the_minimum_is_invalid_fails + # int below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -3, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_float_below_the_minimum_is_invalid_fails + # float below the minimum is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0001 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + -2.0001, + _configuration=self._configuration + ) + self.api.post_minimum_validation_with_signed_integer_request_body(body=body) + + # test_boundary_point_with_float_is_valid_passes + # boundary point with float is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -2.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_negative_above_the_minimum_is_valid_passes + # negative above the minimum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + -1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_numbers_passes + # ignores non-numbers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "x" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minimum_validation_with_signed_integer_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinimumValidationWithSignedIntegerRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minitems_validation_request_body(self): + """Test case for post_minitems_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_minitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_minitems_validation_request_body(body=body) + + # test_ignores_non_arrays_passes + # ignores non-arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minlength_validation_request_body(self): + """Test case for post_minlength_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_minlength_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "f" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "f", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_one_supplementary_unicode_code_point_is_not_long_enough_fails + # one supplementary Unicode code point is not long enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "💩" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "💩", + _configuration=self._configuration + ) + self.api.post_minlength_validation_request_body(body=body) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_non_strings_passes + # ignores non-strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "fo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minlength_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinlengthValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_minproperties_validation_request_body(self): + """Test case for post_minproperties_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_minproperties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_too_short_is_invalid_fails + # too short is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_minproperties_validation_request_body(body=body) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_longer_is_valid_passes + # longer is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_exact_length_is_valid_passes + # exact length is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_minproperties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postMinpropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_allof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_allof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_nested_allof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_allof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_allof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_anyof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_anyof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_nested_anyof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_anyof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_anyof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_nested_items_request_body(self): + """Test case for post_nested_items_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_nested_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_valid_nested_array_passes + # valid nested array + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + 1, + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_nested_array_with_invalid_type_fails + # nested array with invalid type + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + [ + "1", + ], + ], + [ + [ + 2, + ], + [ + 3, + ], + ], + ], + [ + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + # test_not_deep_enough_fails + # not deep enough + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + [ + 1, + ], + [ + 2, + ], + [ + 3, + ], + ], + [ + [ + 4, + ], + [ + 5, + ], + [ + 6, + ], + ], + ], + _configuration=self._configuration + ) + self.api.post_nested_items_request_body(body=body) + + + + def test_post_nested_oneof_to_check_validation_semantics_request_body(self): + """Test case for post_nested_oneof_to_check_validation_semantics_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_nested_oneof_to_check_validation_semantics_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_anything_non_null_is_invalid_fails + # anything non-null is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_nested_oneof_to_check_validation_semantics_request_body(body=body) + + # test_null_is_valid_passes + # null is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nested_oneof_to_check_validation_semantics_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_more_complex_schema_request_body(self): + """Test case for post_not_more_complex_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_not_more_complex_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_other_match_passes + # other match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_mismatch_fails + # mismatch + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "bar", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "bar", + }, + _configuration=self._configuration + ) + self.api.post_not_more_complex_schema_request_body(body=body) + + # test_match_passes + # match + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_more_complex_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotMoreComplexSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_not_request_body(self): + """Test case for post_not_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_not_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_allowed_passes + # allowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_not_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNotRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_disallowed_fails + # disallowed + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_not_request_body(body=body) + + + + def test_post_nul_characters_in_strings_request_body(self): + """Test case for post_nul_characters_in_strings_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_nul_characters_in_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_match_string_with_nul_passes + # match string with nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hello\x00there" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_nul_characters_in_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNulCharactersInStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_do_not_match_string_lacking_nul_fails + # do not match string lacking nul + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "hellothere" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "hellothere", + _configuration=self._configuration + ) + self.api.post_nul_characters_in_strings_request_body(body=body) + + + + def test_post_null_type_matches_only_the_null_object_request_body(self): + """Test case for post_null_type_matches_only_the_null_object_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_null_type_matches_only_the_null_object_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_null_fails + # a float is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_object_is_not_null_fails + # an object is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_false_is_not_null_fails + # false is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + False, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_integer_is_not_null_fails + # an integer is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_true_is_not_null_fails + # true is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_zero_is_not_null_fails + # zero is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 0 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 0, + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_an_empty_string_is_not_null_fails + # an empty string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_null_is_null_passes + # null is null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_null_type_matches_only_the_null_object_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_array_is_not_null_fails + # an array is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + # test_a_string_is_not_null_fails + # a string is not null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_null_type_matches_only_the_null_object_request_body(body=body) + + + + def test_post_number_type_matches_numbers_request_body(self): + """Test case for post_number_type_matches_numbers_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_number_type_matches_numbers_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_an_array_is_not_a_number_fails + # an array is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_null_is_not_a_number_fails + # null is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_object_is_not_a_number_fails + # an object is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_boolean_is_not_a_number_fails + # a boolean is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_float_is_a_number_passes + # a float is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails + # a string is still not a number, even if it looks like one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "1", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_a_string_is_not_a_number_fails + # a string is not a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_number_type_matches_numbers_request_body(body=body) + + # test_an_integer_is_a_number_passes + # an integer is a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes + # a float with zero fractional part is a number (and an integer) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_number_type_matches_numbers_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postNumberTypeMatchesNumbersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_object_properties_validation_request_body(self): + """Test case for post_object_properties_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_object_properties_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_one_property_invalid_is_invalid_fails + # one property invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 1, + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + # test_both_properties_present_and_valid_is_valid_passes + # both properties present and valid is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + "bar": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_doesn_t_invalidate_other_properties_passes + # doesn't invalidate other properties + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "quux": + [ + ], + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_properties_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectPropertiesValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_properties_invalid_is_invalid_fails + # both properties invalid is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + [ + ], + "bar": + { + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + [ + ], + "bar": + { + }, + }, + _configuration=self._configuration + ) + self.api.post_object_properties_validation_request_body(body=body) + + + + def test_post_object_type_matches_objects_request_body(self): + """Test case for post_object_type_matches_objects_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_object_type_matches_objects_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_a_float_is_not_an_object_fails + # a float is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_null_is_not_an_object_fails + # null is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_array_is_not_an_object_fails + # an array is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_object_is_an_object_passes + # an object is an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_object_type_matches_objects_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postObjectTypeMatchesObjectsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_string_is_not_an_object_fails + # a string is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_an_integer_is_not_an_object_fails + # an integer is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + # test_a_boolean_is_not_an_object_fails + # a boolean is not an object + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_object_type_matches_objects_request_body(body=body) + + + + def test_post_oneof_complex_types_request_body(self): + """Test case for post_oneof_complex_types_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_oneof_complex_types_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_first_oneof_valid_complex_passes + # first oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 2, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_complex_fails + # neither oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 2, + "bar": + "quux", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + 2, + "bar": + "quux", + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_both_oneof_valid_complex_fails + # both oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + "bar": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo": + "baz", + "bar": + 2, + }, + _configuration=self._configuration + ) + self.api.post_oneof_complex_types_request_body(body=body) + + # test_second_oneof_valid_complex_passes + # second oneOf valid (complex) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + "baz", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_complex_types_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofComplexTypesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_request_body(self): + """Test case for post_oneof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_second_oneof_valid_passes + # second oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 2.5 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + # test_first_oneof_valid_passes + # first oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_neither_oneof_valid_fails + # neither oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.5 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.5, + _configuration=self._configuration + ) + self.api.post_oneof_request_body(body=body) + + + + def test_post_oneof_with_base_schema_request_body(self): + """Test case for post_oneof_with_base_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_oneof_with_base_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_oneof_valid_fails + # both oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "foo", + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_mismatch_base_schema_fails + # mismatch base schema + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 3 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 3, + _configuration=self._configuration + ) + self.api.post_oneof_with_base_schema_request_body(body=body) + + # test_one_oneof_valid_passes + # one oneOf valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foobar" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_base_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithBaseSchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_oneof_with_empty_schema_request_body(self): + """Test case for post_oneof_with_empty_schema_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_oneof_with_empty_schema_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_both_valid_invalid_fails + # both valid - invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 123, + _configuration=self._configuration + ) + self.api.post_oneof_with_empty_schema_request_body(body=body) + + # test_one_valid_valid_passes + # one valid - valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_oneof_with_empty_schema_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postOneofWithEmptySchemaRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_is_not_anchored_request_body(self): + """Test case for post_pattern_is_not_anchored_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_pattern_is_not_anchored_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_matches_a_substring_passes + # matches a substring + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "xxaayy" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_is_not_anchored_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternIsNotAnchoredRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_pattern_validation_request_body(self): + """Test case for post_pattern_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_pattern_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_objects_passes + # ignores objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_null_passes + # ignores null + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_floats_passes + # ignores floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.0 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_non_matching_pattern_is_invalid_fails + # a non-matching pattern is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "abc" + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + "abc", + _configuration=self._configuration + ) + self.api.post_pattern_validation_request_body(body=body) + + # test_ignores_booleans_passes + # ignores booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_matching_pattern_is_valid_passes + # a matching pattern is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "aaa" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_integers_passes + # ignores integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 123 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_pattern_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPatternValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_properties_with_escaped_characters_request_body(self): + """Test case for post_properties_with_escaped_characters_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_properties_with_escaped_characters_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_object_with_all_numbers_is_valid_passes + # object with all numbers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + 1, + "foo\"bar": + 1, + "foo\\bar": + 1, + "foo\rbar": + 1, + "foo\tbar": + 1, + "foo\fbar": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_properties_with_escaped_characters_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertiesWithEscapedCharactersRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_object_with_strings_is_invalid_fails + # object with strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "foo\nbar": + "1", + "foo\"bar": + "1", + "foo\\bar": + "1", + "foo\rbar": + "1", + "foo\tbar": + "1", + "foo\fbar": + "1", + }, + _configuration=self._configuration + ) + self.api.post_properties_with_escaped_characters_request_body(body=body) + + + + def test_post_property_named_ref_that_is_not_a_reference_request_body(self): + """Test case for post_property_named_ref_that_is_not_a_reference_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_property_named_ref_that_is_not_a_reference_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_property_named_ref_that_is_not_a_reference_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_property_named_ref_that_is_not_a_reference_request_body(body=body) + + + + def test_post_ref_in_additionalproperties_request_body(self): + """Test case for post_ref_in_additionalproperties_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_additionalproperties_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_additionalproperties_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAdditionalpropertiesRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "someProp": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "someProp": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_additionalproperties_request_body(body=body) + + + + def test_post_ref_in_allof_request_body(self): + """Test case for post_ref_in_allof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_allof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_allof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAllofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_allof_request_body(body=body) + + + + def test_post_ref_in_anyof_request_body(self): + """Test case for post_ref_in_anyof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_anyof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_anyof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInAnyofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_anyof_request_body(body=body) + + + + def test_post_ref_in_items_request_body(self): + """Test case for post_ref_in_items_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_items_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + "a", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_items_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInItemsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "$ref": + 2, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "$ref": + 2, + }, + ], + _configuration=self._configuration + ) + self.api.post_ref_in_items_request_body(body=body) + + + + def test_post_ref_in_oneof_request_body(self): + """Test case for post_ref_in_oneof_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_oneof_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + "a", + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_oneof_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInOneofRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "$ref": + 2, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "$ref": + 2, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_oneof_request_body(body=body) + + + + def test_post_ref_in_property_request_body(self): + """Test case for post_ref_in_property_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_ref_in_property_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_named_ref_valid_passes + # property named $ref valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + "a", + }, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_ref_in_property_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRefInPropertyRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_property_named_ref_invalid_fails + # property named $ref invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "a": + { + "$ref": + 2, + }, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "a": + { + "$ref": + 2, + }, + }, + _configuration=self._configuration + ) + self.api.post_ref_in_property_request_body(body=body) + + + + def test_post_required_default_validation_request_body(self): + """Test case for post_required_default_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_required_default_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_not_required_by_default_passes + # not required by default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_default_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredDefaultValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_required_validation_request_body(self): + """Test case for post_required_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_required_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_ignores_arrays_passes + # ignores arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_present_required_property_is_valid_passes + # present required property is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "foo": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_other_non_objects_passes + # ignores other non-objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_ignores_strings_passes + # ignores strings + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_present_required_property_is_invalid_fails + # non-present required property is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "bar": + 1, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "bar": + 1, + }, + _configuration=self._configuration + ) + self.api.post_required_validation_request_body(body=body) + + + + def test_post_required_with_empty_array_request_body(self): + """Test case for post_required_with_empty_array_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_required_with_empty_array_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_property_not_required_passes + # property not required + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_required_with_empty_array_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postRequiredWithEmptyArrayRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_simple_enum_validation_request_body(self): + """Test case for post_simple_enum_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_simple_enum_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_something_else_is_invalid_fails + # something else is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 4 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 4, + _configuration=self._configuration + ) + self.api.post_simple_enum_validation_request_body(body=body) + + # test_one_of_the_enum_is_valid_passes + # one of the enum is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_simple_enum_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postSimpleEnumValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_string_type_matches_strings_request_body(self): + """Test case for post_string_type_matches_strings_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_string_type_matches_strings_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_1_is_not_a_string_fails + # 1 is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes + # a string is still a string, even if it looks like a number + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "1" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_empty_string_is_still_a_string_passes + # an empty string is still a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_float_is_not_a_string_fails + # a float is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 1.1 + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + 1.1, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_object_is_not_a_string_fails + # an object is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + }, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_an_array_is_not_a_string_fails + # an array is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + ], + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_boolean_is_not_a_string_fails + # a boolean is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + True + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + True, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_null_is_not_a_string_fails + # null is not a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + None, + _configuration=self._configuration + ) + self.api.post_string_type_matches_strings_request_body(body=body) + + # test_a_string_is_a_string_passes + # a string is a string + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + "foo" + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_string_type_matches_strings_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postStringTypeMatchesStringsRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(self): + """Test case for post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_missing_properties_are_not_filled_in_with_the_default_passes + # missing properties are not filled in with the default + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_passing_passes + # an explicit property value is checked against maximum (passing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 1, + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_an_explicit_property_value_is_checked_against_maximum_failing_fails + # an explicit property value is checked against maximum (failing) + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + "alpha": + 5, + } + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + { + "alpha": + 5, + }, + _configuration=self._configuration + ) + self.api.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body(body=body) + + + + def test_post_uniqueitems_false_validation_request_body(self): + """Test case for post_uniqueitems_false_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_uniqueitems_false_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_non_unique_array_of_integers_is_valid_passes + # non-unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_valid_passes + # non-unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_objects_is_valid_passes + # non-unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # 1 and true are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_valid_passes + # non-unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_passes + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # 0 and false are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_valid_passes + # non-unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_false_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsFalseValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uniqueitems_validation_request_body(self): + """Test case for post_uniqueitems_validation_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_uniqueitems_validation_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_unique_array_of_objects_is_valid_passes + # unique array of objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "baz", + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_true_and_a1_are_unique_passes + # {"a": true} and {"a": 1} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + True, + }, + { + "a": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_heterogeneous_types_are_invalid_fails + # non-unique heterogeneous types are invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + }, + [ + 1, + ], + True, + None, + { + }, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested0_and_false_are_unique_passes + # nested [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 0, + ], + "foo", + ], + [ + [ + False, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_a_false_and_a0_are_unique_passes + # {"a": false} and {"a": 0} are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + False, + }, + { + "a": + 0, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_numbers_are_unique_if_mathematically_unequal_fails + # numbers are unique if mathematically unequal + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1.0, + 1.0, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1.0, + 1.0, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_false_is_not_equal_to_zero_passes + # false is not equal to zero + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 0, + False, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_0_and_false_are_unique_passes + # [0] and [false] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 0, + ], + [ + False, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_arrays_is_valid_passes + # unique array of arrays is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_nested_objects_is_invalid_fails + # non-unique array of nested objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_more_than_two_integers_is_invalid_fails + # non-unique array of more than two integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 2, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_true_is_not_equal_to_one_passes + # true is not equal to one + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + True, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_objects_are_non_unique_despite_key_order_fails + # objects are non-unique despite key order + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "a": + 1, + "b": + 2, + }, + { + "b": + 2, + "a": + 1, + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_strings_is_valid_passes + # unique array of strings is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "baz", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_1_and_true_are_unique_passes + # [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + 1, + ], + [ + True, + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_different_objects_are_unique_passes + # different objects are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "a": + 1, + "b": + 2, + }, + { + "a": + 2, + "b": + 1, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_array_of_integers_is_valid_passes + # unique array of integers is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 2, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_more_than_two_arrays_is_invalid_fails + # non-unique array of more than two arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "bar", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_objects_is_invalid_fails + # non-unique array of objects is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + { + "foo": + "bar", + }, + { + "foo": + "bar", + }, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_unique_array_of_nested_objects_is_valid_passes + # unique array of nested objects is valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + "foo": + { + "bar": + { + "baz": + True, + }, + }, + }, + { + "foo": + { + "bar": + { + "baz": + False, + }, + }, + }, + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_arrays_is_invalid_fails + # non-unique array of arrays is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + "foo", + ], + [ + "foo", + ], + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + [ + "foo", + ], + [ + "foo", + ], + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_non_unique_array_of_strings_is_invalid_fails + # non-unique array of strings is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + "foo", + "bar", + "foo", + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + "foo", + "bar", + "foo", + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + # test_nested1_and_true_are_unique_passes + # nested [1] and [true] are unique + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + [ + [ + 1, + ], + "foo", + ], + [ + [ + True, + ], + "foo", + ], + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_unique_heterogeneous_types_are_valid_passes + # unique heterogeneous types are valid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + { + }, + [ + 1, + ], + True, + None, + 1, + "{}", + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uniqueitems_validation_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUniqueitemsValidationRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_non_unique_array_of_integers_is_invalid_fails + # non-unique array of integers is invalid + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + 1, + 1, + ] + ) + with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + [ + 1, + 1, + ], + _configuration=self._configuration + ) + self.api.post_uniqueitems_validation_request_body(body=body) + + + + def test_post_uri_format_request_body(self): + """Test case for post_uri_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_uri_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_reference_format_request_body(self): + """Test case for post_uri_reference_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_uri_reference_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_reference_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriReferenceFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + def test_post_uri_template_format_request_body(self): + """Test case for post_uri_template_format_request_body + + """ + from unit_test_api.api.request_body_api_endpoints import post_uri_template_format_request_body as endpoint_module + response_status = 200 + response_body = '' + content_type = 'application/json' + + # test_all_string_formats_ignore_objects_passes + # all string formats ignore objects + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + { + } + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_booleans_passes + # all string formats ignore booleans + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + False + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_integers_passes + # all string formats ignore integers + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 12 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_floats_passes + # all string formats ignore floats + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + 13.7 + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_arrays_passes + # all string formats ignore arrays + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + [ + ] + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + # test_all_string_formats_ignore_nulls_passes + # all string formats ignore nulls + with patch.object(urllib3.PoolManager, 'request') as mock_request: + request_payload = ( + None + ) + body = endpoint_module.SchemaForRequestBodyApplicationJson._from_openapi_data( + request_payload, + _configuration=self._configuration + ) + mock_request.return_value = self.response( + self.json_bytes(response_body), + status=response_status + ) + api_response = self.api.post_uri_template_format_request_body( + body=body, + content_type=content_type + ) + self.assert_pool_manager_request_called_with( + mock_request, + self._configuration.host + '/requestBody/postUriTemplateFormatRequestBody', + method='POST', + body=self.json_bytes(request_payload), + content_type=content_type, + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + # TODO if response body is unset check that it is unset here + assert isinstance(api_response.body, schemas.Unset) + + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/__init__.py index e69de29bb2d..7adbd86e57e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/__init__.py @@ -0,0 +1,3 @@ +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from unit_test_api.apis import JsonApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api.py new file mode 100644 index 00000000000..dfe85899ef3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api.py @@ -0,0 +1,191 @@ +# 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 +""" + +from unit_test_api.api_client import ApiClient +from unit_test_api.api.json_api_endpoints.post_additionalproperties_allows_a_schema_which_should_validate_request_body import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.api.json_api_endpoints.post_additionalproperties_are_allowed_by_default_request_body import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.api.json_api_endpoints.post_additionalproperties_can_exist_by_itself_request_body import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.api.json_api_endpoints.post_additionalproperties_should_not_look_in_applicators_request_body import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_combined_with_anyof_oneof_request_body import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_request_body import PostAllofRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_simple_types_request_body import PostAllofSimpleTypesRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_with_base_schema_request_body import PostAllofWithBaseSchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_with_one_empty_schema_request_body import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_with_the_first_empty_schema_request_body import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_with_the_last_empty_schema_request_body import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_allof_with_two_empty_schemas_request_body import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.api.json_api_endpoints.post_anyof_complex_types_request_body import PostAnyofComplexTypesRequestBody +from unit_test_api.api.json_api_endpoints.post_anyof_request_body import PostAnyofRequestBody +from unit_test_api.api.json_api_endpoints.post_anyof_with_base_schema_request_body import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_anyof_with_one_empty_schema_request_body import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_array_type_matches_arrays_request_body import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.api.json_api_endpoints.post_boolean_type_matches_booleans_request_body import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.api.json_api_endpoints.post_by_int_request_body import PostByIntRequestBody +from unit_test_api.api.json_api_endpoints.post_by_number_request_body import PostByNumberRequestBody +from unit_test_api.api.json_api_endpoints.post_by_small_number_request_body import PostBySmallNumberRequestBody +from unit_test_api.api.json_api_endpoints.post_date_time_format_request_body import PostDateTimeFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_email_format_request_body import PostEmailFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_enum_with0_does_not_match_false_request_body import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.api.json_api_endpoints.post_enum_with1_does_not_match_true_request_body import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.api.json_api_endpoints.post_enum_with_escaped_characters_request_body import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.api.json_api_endpoints.post_enum_with_false_does_not_match0_request_body import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.api.json_api_endpoints.post_enum_with_true_does_not_match1_request_body import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.api.json_api_endpoints.post_enums_in_properties_request_body import PostEnumsInPropertiesRequestBody +from unit_test_api.api.json_api_endpoints.post_forbidden_property_request_body import PostForbiddenPropertyRequestBody +from unit_test_api.api.json_api_endpoints.post_hostname_format_request_body import PostHostnameFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_integer_type_matches_integers_request_body import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.api.json_api_endpoints.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.api.json_api_endpoints.post_invalid_string_value_for_default_request_body import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.api.json_api_endpoints.post_ipv4_format_request_body import PostIpv4FormatRequestBody +from unit_test_api.api.json_api_endpoints.post_ipv6_format_request_body import PostIpv6FormatRequestBody +from unit_test_api.api.json_api_endpoints.post_json_pointer_format_request_body import PostJsonPointerFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_maximum_validation_request_body import PostMaximumValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_maximum_validation_with_unsigned_integer_request_body import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.api.json_api_endpoints.post_maxitems_validation_request_body import PostMaxitemsValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_maxlength_validation_request_body import PostMaxlengthValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_maxproperties0_means_the_object_is_empty_request_body import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.api.json_api_endpoints.post_maxproperties_validation_request_body import PostMaxpropertiesValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_minimum_validation_request_body import PostMinimumValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_minimum_validation_with_signed_integer_request_body import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.api.json_api_endpoints.post_minitems_validation_request_body import PostMinitemsValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_minlength_validation_request_body import PostMinlengthValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_minproperties_validation_request_body import PostMinpropertiesValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_nested_allof_to_check_validation_semantics_request_body import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.api.json_api_endpoints.post_nested_anyof_to_check_validation_semantics_request_body import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.api.json_api_endpoints.post_nested_items_request_body import PostNestedItemsRequestBody +from unit_test_api.api.json_api_endpoints.post_nested_oneof_to_check_validation_semantics_request_body import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.api.json_api_endpoints.post_not_more_complex_schema_request_body import PostNotMoreComplexSchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_not_request_body import PostNotRequestBody +from unit_test_api.api.json_api_endpoints.post_nul_characters_in_strings_request_body import PostNulCharactersInStringsRequestBody +from unit_test_api.api.json_api_endpoints.post_null_type_matches_only_the_null_object_request_body import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.api.json_api_endpoints.post_number_type_matches_numbers_request_body import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.api.json_api_endpoints.post_object_properties_validation_request_body import PostObjectPropertiesValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_object_type_matches_objects_request_body import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.api.json_api_endpoints.post_oneof_complex_types_request_body import PostOneofComplexTypesRequestBody +from unit_test_api.api.json_api_endpoints.post_oneof_request_body import PostOneofRequestBody +from unit_test_api.api.json_api_endpoints.post_oneof_with_base_schema_request_body import PostOneofWithBaseSchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_oneof_with_empty_schema_request_body import PostOneofWithEmptySchemaRequestBody +from unit_test_api.api.json_api_endpoints.post_pattern_is_not_anchored_request_body import PostPatternIsNotAnchoredRequestBody +from unit_test_api.api.json_api_endpoints.post_pattern_validation_request_body import PostPatternValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_properties_with_escaped_characters_request_body import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.api.json_api_endpoints.post_property_named_ref_that_is_not_a_reference_request_body import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_additionalproperties_request_body import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_allof_request_body import PostRefInAllofRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_anyof_request_body import PostRefInAnyofRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_items_request_body import PostRefInItemsRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_oneof_request_body import PostRefInOneofRequestBody +from unit_test_api.api.json_api_endpoints.post_ref_in_property_request_body import PostRefInPropertyRequestBody +from unit_test_api.api.json_api_endpoints.post_required_default_validation_request_body import PostRequiredDefaultValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_required_validation_request_body import PostRequiredValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_required_with_empty_array_request_body import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.api.json_api_endpoints.post_simple_enum_validation_request_body import PostSimpleEnumValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_string_type_matches_strings_request_body import PostStringTypeMatchesStringsRequestBody +from unit_test_api.api.json_api_endpoints.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.api.json_api_endpoints.post_uniqueitems_false_validation_request_body import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_uniqueitems_validation_request_body import PostUniqueitemsValidationRequestBody +from unit_test_api.api.json_api_endpoints.post_uri_format_request_body import PostUriFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_uri_reference_format_request_body import PostUriReferenceFormatRequestBody +from unit_test_api.api.json_api_endpoints.post_uri_template_format_request_body import PostUriTemplateFormatRequestBody + + +class JsonApi( + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostAllofRequestBody, + PostAllofSimpleTypesRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostAllofWithTheLastEmptySchemaRequestBody, + PostAllofWithTwoEmptySchemasRequestBody, + PostAnyofComplexTypesRequestBody, + PostAnyofRequestBody, + PostAnyofWithBaseSchemaRequestBody, + PostAnyofWithOneEmptySchemaRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostBooleanTypeMatchesBooleansRequestBody, + PostByIntRequestBody, + PostByNumberRequestBody, + PostBySmallNumberRequestBody, + PostDateTimeFormatRequestBody, + PostEmailFormatRequestBody, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostEnumsInPropertiesRequestBody, + PostForbiddenPropertyRequestBody, + PostHostnameFormatRequestBody, + PostIntegerTypeMatchesIntegersRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostInvalidStringValueForDefaultRequestBody, + PostIpv4FormatRequestBody, + PostIpv6FormatRequestBody, + PostJsonPointerFormatRequestBody, + PostMaximumValidationRequestBody, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostMaxitemsValidationRequestBody, + PostMaxlengthValidationRequestBody, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostMaxpropertiesValidationRequestBody, + PostMinimumValidationRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostMinitemsValidationRequestBody, + PostMinlengthValidationRequestBody, + PostMinpropertiesValidationRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostNestedItemsRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostNotMoreComplexSchemaRequestBody, + PostNotRequestBody, + PostNulCharactersInStringsRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostObjectPropertiesValidationRequestBody, + PostObjectTypeMatchesObjectsRequestBody, + PostOneofComplexTypesRequestBody, + PostOneofRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostOneofWithEmptySchemaRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostPatternValidationRequestBody, + PostPropertiesWithEscapedCharactersRequestBody, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostRefInAdditionalpropertiesRequestBody, + PostRefInAllofRequestBody, + PostRefInAnyofRequestBody, + PostRefInItemsRequestBody, + PostRefInOneofRequestBody, + PostRefInPropertyRequestBody, + PostRequiredDefaultValidationRequestBody, + PostRequiredValidationRequestBody, + PostRequiredWithEmptyArrayRequestBody, + PostSimpleEnumValidationRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostUniqueitemsValidationRequestBody, + PostUriFormatRequestBody, + PostUriReferenceFormatRequestBody, + PostUriTemplateFormatRequestBody, + ApiClient, +): + """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/api/json_api_endpoints/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/__init__.py new file mode 100644 index 00000000000..fa511a84fed --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.api.json_api import JsonApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py new file mode 100644 index 00000000000..74eb180d682 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate + + +request_body_additionalproperties_allows_a_schema_which_should_validate = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(api_client.Api): + + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_allows_a_schema_which_should_validate.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py new file mode 100644 index 00000000000..152dd761193 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault + + +request_body_additionalproperties_are_allowed_by_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(api_client.Api): + + def post_additionalproperties_are_allowed_by_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_are_allowed_by_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py new file mode 100644 index 00000000000..06d4f848703 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself + + +request_body_additionalproperties_can_exist_by_itself = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesCanExistByItselfRequestBody(api_client.Api): + + def post_additionalproperties_can_exist_by_itself_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_can_exist_by_itself.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py new file mode 100644 index 00000000000..e2124b4819a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators + + +request_body_additionalproperties_should_not_look_in_applicators = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(api_client.Api): + + def post_additionalproperties_should_not_look_in_applicators_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_should_not_look_in_applicators.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py new file mode 100644 index 00000000000..8225f31a357 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof + +# body param +SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof + + +request_body_allof_combined_with_anyof_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofCombinedWithAnyofOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofCombinedWithAnyofOneofRequestBody(api_client.Api): + + def post_allof_combined_with_anyof_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_combined_with_anyof_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_request_body.py new file mode 100644 index 00000000000..a21978a91ad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof import Allof + +# body param +SchemaForRequestBodyApplicationJson = Allof + + +request_body_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofRequestBody(api_client.Api): + + def post_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_simple_types_request_body.py new file mode 100644 index 00000000000..ff3435c1aec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_simple_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_simple_types import AllofSimpleTypes + +# body param +SchemaForRequestBodyApplicationJson = AllofSimpleTypes + + +request_body_allof_simple_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofSimpleTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofSimpleTypesRequestBody(api_client.Api): + + def post_allof_simple_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_simple_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_base_schema_request_body.py new file mode 100644 index 00000000000..080eb4703ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithBaseSchema + + +request_body_allof_with_base_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithBaseSchemaRequestBody(api_client.Api): + + def post_allof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_base_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..2d47e3831d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema + + +request_body_allof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py new file mode 100644 index 00000000000..7b9ad71e9d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema + + +request_body_allof_with_the_first_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheFirstEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_first_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_first_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py new file mode 100644 index 00000000000..a7e1aec6d44 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema + + +request_body_allof_with_the_last_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheLastEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheLastEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_last_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_last_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_two_empty_schemas_request_body.py new file mode 100644 index 00000000000..f45409101b2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_allof_with_two_empty_schemas_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas + + +request_body_allof_with_two_empty_schemas = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTwoEmptySchemasRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTwoEmptySchemasRequestBody(api_client.Api): + + def post_allof_with_two_empty_schemas_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_two_empty_schemas.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_complex_types_request_body.py new file mode 100644 index 00000000000..a5a041b43af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = AnyofComplexTypes + + +request_body_anyof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofComplexTypesRequestBody(api_client.Api): + + def post_anyof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_request_body.py new file mode 100644 index 00000000000..4b7d8568b30 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof import Anyof + +# body param +SchemaForRequestBodyApplicationJson = Anyof + + +request_body_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofRequestBody(api_client.Api): + + def post_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_base_schema_request_body.py new file mode 100644 index 00000000000..27d7ade8535 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithBaseSchemaRequestBody(api_client.Api): + + def post_anyof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..18d0ceb7a2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_anyof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema + + +request_body_anyof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_anyof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_array_type_matches_arrays_request_body.py new file mode 100644 index 00000000000..57dd448efff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_array_type_matches_arrays_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays + +# body param +SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays + + +request_body_array_type_matches_arrays = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postArrayTypeMatchesArraysRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostArrayTypeMatchesArraysRequestBody(api_client.Api): + + def post_array_type_matches_arrays_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_array_type_matches_arrays.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_boolean_type_matches_booleans_request_body.py new file mode 100644 index 00000000000..eabe24adecf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_boolean_type_matches_booleans_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = BoolSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBooleanTypeMatchesBooleansRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBooleanTypeMatchesBooleansRequestBody(api_client.Api): + + def post_boolean_type_matches_booleans_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_int_request_body.py new file mode 100644 index 00000000000..90071628eaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_int_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_int import ByInt + +# body param +SchemaForRequestBodyApplicationJson = ByInt + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByIntRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByIntRequestBody(api_client.Api): + + def post_by_int_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_number_request_body.py new file mode 100644 index 00000000000..b1be0348fc5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_number import ByNumber + +# body param +SchemaForRequestBodyApplicationJson = ByNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByNumberRequestBody(api_client.Api): + + def post_by_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_small_number_request_body.py new file mode 100644 index 00000000000..5931bf8dd72 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_by_small_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_small_number import BySmallNumber + +# body param +SchemaForRequestBodyApplicationJson = BySmallNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBySmallNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBySmallNumberRequestBody(api_client.Api): + + def post_by_small_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_date_time_format_request_body.py new file mode 100644 index 00000000000..811f0300ec8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_date_time_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postDateTimeFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostDateTimeFormatRequestBody(api_client.Api): + + def post_date_time_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_email_format_request_body.py new file mode 100644 index 00000000000..2e1fa2846a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_email_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEmailFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEmailFormatRequestBody(api_client.Api): + + def post_email_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with0_does_not_match_false_request_body.py new file mode 100644 index 00000000000..dcb00bc5fbd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with0_does_not_match_false_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse + +# body param +SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith0DoesNotMatchFalseRequestBody(api_client.Api): + + def post_enum_with0_does_not_match_false_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with1_does_not_match_true_request_body.py new file mode 100644 index 00000000000..7c2bdecbcc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with1_does_not_match_true_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue + +# body param +SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith1DoesNotMatchTrueRequestBody(api_client.Api): + + def post_enum_with1_does_not_match_true_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..6f6d235b1e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithEscapedCharactersRequestBody(api_client.Api): + + def post_enum_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_false_does_not_match0_request_body.py new file mode 100644 index 00000000000..8a7a03b2a95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_false_does_not_match0_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithFalseDoesNotMatch0RequestBody(api_client.Api): + + def post_enum_with_false_does_not_match0_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_true_does_not_match1_request_body.py new file mode 100644 index 00000000000..7242ce845f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enum_with_true_does_not_match1_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithTrueDoesNotMatch1RequestBody(api_client.Api): + + def post_enum_with_true_does_not_match1_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enums_in_properties_request_body.py new file mode 100644 index 00000000000..d06295fff6e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_enums_in_properties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enums_in_properties import EnumsInProperties + +# body param +SchemaForRequestBodyApplicationJson = EnumsInProperties + + +request_body_enums_in_properties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumsInPropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumsInPropertiesRequestBody(api_client.Api): + + def post_enums_in_properties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_enums_in_properties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_forbidden_property_request_body.py new file mode 100644 index 00000000000..0fdb8617e74 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_forbidden_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.forbidden_property import ForbiddenProperty + +# body param +SchemaForRequestBodyApplicationJson = ForbiddenProperty + + +request_body_forbidden_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postForbiddenPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostForbiddenPropertyRequestBody(api_client.Api): + + def post_forbidden_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_forbidden_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_hostname_format_request_body.py new file mode 100644 index 00000000000..482b8e4f91a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_hostname_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postHostnameFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostHostnameFormatRequestBody(api_client.Api): + + def post_hostname_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_integer_type_matches_integers_request_body.py new file mode 100644 index 00000000000..6c7d7d4652d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_integer_type_matches_integers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = IntSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIntegerTypeMatchesIntegersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIntegerTypeMatchesIntegersRequestBody(api_client.Api): + + def post_integer_type_matches_integers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py new file mode 100644 index 00000000000..1141ec8135f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + +# body param +SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(api_client.Api): + + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_string_value_for_default_request_body.py new file mode 100644 index 00000000000..072cdeff98a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_invalid_string_value_for_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault + +# body param +SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault + + +request_body_invalid_string_value_for_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidStringValueForDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidStringValueForDefaultRequestBody(api_client.Api): + + def post_invalid_string_value_for_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_invalid_string_value_for_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv4_format_request_body.py new file mode 100644 index 00000000000..4504a5cf7bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv4_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv4FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv4FormatRequestBody(api_client.Api): + + def post_ipv4_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv6_format_request_body.py new file mode 100644 index 00000000000..e1f7572a6cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ipv6_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv6FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv6FormatRequestBody(api_client.Api): + + def post_ipv6_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_json_pointer_format_request_body.py new file mode 100644 index 00000000000..d24cb5c5db0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_json_pointer_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postJsonPointerFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostJsonPointerFormatRequestBody(api_client.Api): + + def post_json_pointer_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_request_body.py new file mode 100644 index 00000000000..d79c50215fa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation import MaximumValidation + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationRequestBody(api_client.Api): + + def post_maximum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py new file mode 100644 index 00000000000..67b5b06f2e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationWithUnsignedIntegerRequestBody(api_client.Api): + + def post_maximum_validation_with_unsigned_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxitems_validation_request_body.py new file mode 100644 index 00000000000..573edabf721 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxitems_validation import MaxitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxitemsValidationRequestBody(api_client.Api): + + def post_maxitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxlength_validation_request_body.py new file mode 100644 index 00000000000..5165e6a4263 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxlength_validation import MaxlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxlengthValidationRequestBody(api_client.Api): + + def post_maxlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py new file mode 100644 index 00000000000..2c40a104afc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty + +# body param +SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(api_client.Api): + + def post_maxproperties0_means_the_object_is_empty_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties_validation_request_body.py new file mode 100644 index 00000000000..9ebc80bff90 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_maxproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxpropertiesValidationRequestBody(api_client.Api): + + def post_maxproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_request_body.py new file mode 100644 index 00000000000..f191aee2072 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation import MinimumValidation + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationRequestBody(api_client.Api): + + def post_minimum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py new file mode 100644 index 00000000000..5ca6f649c60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationWithSignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationWithSignedIntegerRequestBody(api_client.Api): + + def post_minimum_validation_with_signed_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minitems_validation_request_body.py new file mode 100644 index 00000000000..b7f9e9b45f3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minitems_validation import MinitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MinitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinitemsValidationRequestBody(api_client.Api): + + def post_minitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minlength_validation_request_body.py new file mode 100644 index 00000000000..9fbc87a18a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minlength_validation import MinlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MinlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinlengthValidationRequestBody(api_client.Api): + + def post_minlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minproperties_validation_request_body.py new file mode 100644 index 00000000000..330e6561079 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_minproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minproperties_validation import MinpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MinpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinpropertiesValidationRequestBody(api_client.Api): + + def post_minproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..be5eeac206e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics + + +request_body_nested_allof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAllofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_allof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_allof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..c5d6520fc58 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics + + +request_body_nested_anyof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAnyofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_anyof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_anyof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_items_request_body.py new file mode 100644 index 00000000000..a6439bb5618 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_items import NestedItems + +# body param +SchemaForRequestBodyApplicationJson = NestedItems + + +request_body_nested_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedItemsRequestBody(api_client.Api): + + def post_nested_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..e919dd40de6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics + + +request_body_nested_oneof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedOneofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_oneof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_oneof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_more_complex_schema_request_body.py new file mode 100644 index 00000000000..cca040f3496 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_more_complex_schema_request_body.py @@ -0,0 +1,216 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + + + class NotSchema( + DictSchema + ): + foo = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + foo: typing.Union[foo, Unset] = unset, + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'NotSchema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotMoreComplexSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotMoreComplexSchemaRequestBody(api_client.Api): + + def post_not_more_complex_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_request_body.py new file mode 100644 index 00000000000..26a993683de --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_not_request_body.py @@ -0,0 +1,195 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + NotSchema = IntSchema + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotRequestBody(api_client.Api): + + def post_not_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nul_characters_in_strings_request_body.py new file mode 100644 index 00000000000..0cd4f2b03c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_nul_characters_in_strings_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings + +# body param +SchemaForRequestBodyApplicationJson = NulCharactersInStrings + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNulCharactersInStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNulCharactersInStringsRequestBody(api_client.Api): + + def post_nul_characters_in_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py new file mode 100644 index 00000000000..bbe9c2529ae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NoneSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNullTypeMatchesOnlyTheNullObjectRequestBody(api_client.Api): + + def post_null_type_matches_only_the_null_object_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_number_type_matches_numbers_request_body.py new file mode 100644 index 00000000000..8bdc5593dd8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_number_type_matches_numbers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NumberSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNumberTypeMatchesNumbersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNumberTypeMatchesNumbersRequestBody(api_client.Api): + + def post_number_type_matches_numbers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_properties_validation_request_body.py new file mode 100644 index 00000000000..bf67f4e981f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_properties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation + + +request_body_object_properties_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectPropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectPropertiesValidationRequestBody(api_client.Api): + + def post_object_properties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_object_properties_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_type_matches_objects_request_body.py new file mode 100644 index 00000000000..8ecca92de95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_object_type_matches_objects_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = DictSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectTypeMatchesObjectsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectTypeMatchesObjectsRequestBody(api_client.Api): + + def post_object_type_matches_objects_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_complex_types_request_body.py new file mode 100644 index 00000000000..04cfec2d09d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_complex_types import OneofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = OneofComplexTypes + + +request_body_oneof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofComplexTypesRequestBody(api_client.Api): + + def post_oneof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_request_body.py new file mode 100644 index 00000000000..5385a8c94d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof import Oneof + +# body param +SchemaForRequestBodyApplicationJson = Oneof + + +request_body_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofRequestBody(api_client.Api): + + def post_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_base_schema_request_body.py new file mode 100644 index 00000000000..fb23d0bcfdd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithBaseSchemaRequestBody(api_client.Api): + + def post_oneof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_empty_schema_request_body.py new file mode 100644 index 00000000000..95edbc98a65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_oneof_with_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithEmptySchema + + +request_body_oneof_with_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithEmptySchemaRequestBody(api_client.Api): + + def post_oneof_with_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_with_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_is_not_anchored_request_body.py new file mode 100644 index 00000000000..3a2a7b18b84 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_is_not_anchored_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored + +# body param +SchemaForRequestBodyApplicationJson = PatternIsNotAnchored + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternIsNotAnchoredRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternIsNotAnchoredRequestBody(api_client.Api): + + def post_pattern_is_not_anchored_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_validation_request_body.py new file mode 100644 index 00000000000..1e8900bac1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_pattern_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_validation import PatternValidation + +# body param +SchemaForRequestBodyApplicationJson = PatternValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternValidationRequestBody(api_client.Api): + + def post_pattern_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_properties_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..02efabfe995 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_properties_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters + + +request_body_properties_with_escaped_characters = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertiesWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertiesWithEscapedCharactersRequestBody(api_client.Api): + + def post_properties_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_properties_with_escaped_characters.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py new file mode 100644 index 00000000000..2a0f5a933d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference + +# body param +SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference + + +request_body_property_named_ref_that_is_not_a_reference = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertyNamedRefThatIsNotAReferenceRequestBody(api_client.Api): + + def post_property_named_ref_that_is_not_a_reference_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_property_named_ref_that_is_not_a_reference.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_additionalproperties_request_body.py new file mode 100644 index 00000000000..95a5e59a87f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_additionalproperties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties + +# body param +SchemaForRequestBodyApplicationJson = RefInAdditionalproperties + + +request_body_ref_in_additionalproperties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAdditionalpropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAdditionalpropertiesRequestBody(api_client.Api): + + def post_ref_in_additionalproperties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_additionalproperties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_allof_request_body.py new file mode 100644 index 00000000000..d574a98686e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_allof import RefInAllof + +# body param +SchemaForRequestBodyApplicationJson = RefInAllof + + +request_body_ref_in_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAllofRequestBody(api_client.Api): + + def post_ref_in_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_anyof_request_body.py new file mode 100644 index 00000000000..8a02d33492b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_anyof import RefInAnyof + +# body param +SchemaForRequestBodyApplicationJson = RefInAnyof + + +request_body_ref_in_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAnyofRequestBody(api_client.Api): + + def post_ref_in_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_items_request_body.py new file mode 100644 index 00000000000..8fe32a023d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_items import RefInItems + +# body param +SchemaForRequestBodyApplicationJson = RefInItems + + +request_body_ref_in_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInItemsRequestBody(api_client.Api): + + def post_ref_in_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_oneof_request_body.py new file mode 100644 index 00000000000..73c2d4e9680 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_oneof import RefInOneof + +# body param +SchemaForRequestBodyApplicationJson = RefInOneof + + +request_body_ref_in_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInOneofRequestBody(api_client.Api): + + def post_ref_in_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_property_request_body.py new file mode 100644 index 00000000000..10a31753244 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_ref_in_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_property import RefInProperty + +# body param +SchemaForRequestBodyApplicationJson = RefInProperty + + +request_body_ref_in_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInPropertyRequestBody(api_client.Api): + + def post_ref_in_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_default_validation_request_body.py new file mode 100644 index 00000000000..7059686bfa3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_default_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_default_validation import RequiredDefaultValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredDefaultValidation + + +request_body_required_default_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredDefaultValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredDefaultValidationRequestBody(api_client.Api): + + def post_required_default_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_default_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_validation_request_body.py new file mode 100644 index 00000000000..1cd7d8cf296 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_validation import RequiredValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredValidation + + +request_body_required_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredValidationRequestBody(api_client.Api): + + def post_required_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_with_empty_array_request_body.py new file mode 100644 index 00000000000..6bf34d75b60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_required_with_empty_array_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray + +# body param +SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray + + +request_body_required_with_empty_array = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredWithEmptyArrayRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredWithEmptyArrayRequestBody(api_client.Api): + + def post_required_with_empty_array_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_with_empty_array.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_simple_enum_validation_request_body.py new file mode 100644 index 00000000000..af46c1f8580 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_simple_enum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation + +# body param +SchemaForRequestBodyApplicationJson = SimpleEnumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postSimpleEnumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostSimpleEnumValidationRequestBody(api_client.Api): + + def post_simple_enum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_string_type_matches_strings_request_body.py new file mode 100644 index 00000000000..704d093b41a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_string_type_matches_strings_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postStringTypeMatchesStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostStringTypeMatchesStringsRequestBody(api_client.Api): + + def post_string_type_matches_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py new file mode 100644 index 00000000000..3feabb524b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + +# body param +SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + + +request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(api_client.Api): + + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_false_validation_request_body.py new file mode 100644 index 00000000000..6f048e4f347 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_false_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsFalseValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsFalseValidationRequestBody(api_client.Api): + + def post_uniqueitems_false_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_validation_request_body.py new file mode 100644 index 00000000000..09d4d4c710e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uniqueitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsValidationRequestBody(api_client.Api): + + def post_uniqueitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_format_request_body.py new file mode 100644 index 00000000000..84f6c8e7adc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriFormatRequestBody(api_client.Api): + + def post_uri_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_reference_format_request_body.py new file mode 100644 index 00000000000..8b2935bd02e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_reference_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriReferenceFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriReferenceFormatRequestBody(api_client.Api): + + def post_uri_reference_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_template_format_request_body.py new file mode 100644 index 00000000000..352ea7ebdc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/json_api_endpoints/post_uri_template_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriTemplateFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriTemplateFormatRequestBody(api_client.Api): + + def post_uri_template_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api.py new file mode 100644 index 00000000000..600d208658f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api.py @@ -0,0 +1,191 @@ +# 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 +""" + +from unit_test_api.api_client import ApiClient +from unit_test_api.api.post_api_endpoints.post_additionalproperties_allows_a_schema_which_should_validate_request_body import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.api.post_api_endpoints.post_additionalproperties_are_allowed_by_default_request_body import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.api.post_api_endpoints.post_additionalproperties_can_exist_by_itself_request_body import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.api.post_api_endpoints.post_additionalproperties_should_not_look_in_applicators_request_body import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_combined_with_anyof_oneof_request_body import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_request_body import PostAllofRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_simple_types_request_body import PostAllofSimpleTypesRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_with_base_schema_request_body import PostAllofWithBaseSchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_with_one_empty_schema_request_body import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_with_the_first_empty_schema_request_body import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_with_the_last_empty_schema_request_body import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_allof_with_two_empty_schemas_request_body import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.api.post_api_endpoints.post_anyof_complex_types_request_body import PostAnyofComplexTypesRequestBody +from unit_test_api.api.post_api_endpoints.post_anyof_request_body import PostAnyofRequestBody +from unit_test_api.api.post_api_endpoints.post_anyof_with_base_schema_request_body import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_anyof_with_one_empty_schema_request_body import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_array_type_matches_arrays_request_body import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.api.post_api_endpoints.post_boolean_type_matches_booleans_request_body import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.api.post_api_endpoints.post_by_int_request_body import PostByIntRequestBody +from unit_test_api.api.post_api_endpoints.post_by_number_request_body import PostByNumberRequestBody +from unit_test_api.api.post_api_endpoints.post_by_small_number_request_body import PostBySmallNumberRequestBody +from unit_test_api.api.post_api_endpoints.post_date_time_format_request_body import PostDateTimeFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_email_format_request_body import PostEmailFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_enum_with0_does_not_match_false_request_body import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.api.post_api_endpoints.post_enum_with1_does_not_match_true_request_body import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.api.post_api_endpoints.post_enum_with_escaped_characters_request_body import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.api.post_api_endpoints.post_enum_with_false_does_not_match0_request_body import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.api.post_api_endpoints.post_enum_with_true_does_not_match1_request_body import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.api.post_api_endpoints.post_enums_in_properties_request_body import PostEnumsInPropertiesRequestBody +from unit_test_api.api.post_api_endpoints.post_forbidden_property_request_body import PostForbiddenPropertyRequestBody +from unit_test_api.api.post_api_endpoints.post_hostname_format_request_body import PostHostnameFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_integer_type_matches_integers_request_body import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.api.post_api_endpoints.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.api.post_api_endpoints.post_invalid_string_value_for_default_request_body import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.api.post_api_endpoints.post_ipv4_format_request_body import PostIpv4FormatRequestBody +from unit_test_api.api.post_api_endpoints.post_ipv6_format_request_body import PostIpv6FormatRequestBody +from unit_test_api.api.post_api_endpoints.post_json_pointer_format_request_body import PostJsonPointerFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_maximum_validation_request_body import PostMaximumValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_maximum_validation_with_unsigned_integer_request_body import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.api.post_api_endpoints.post_maxitems_validation_request_body import PostMaxitemsValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_maxlength_validation_request_body import PostMaxlengthValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_maxproperties0_means_the_object_is_empty_request_body import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.api.post_api_endpoints.post_maxproperties_validation_request_body import PostMaxpropertiesValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_minimum_validation_request_body import PostMinimumValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_minimum_validation_with_signed_integer_request_body import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.api.post_api_endpoints.post_minitems_validation_request_body import PostMinitemsValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_minlength_validation_request_body import PostMinlengthValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_minproperties_validation_request_body import PostMinpropertiesValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_nested_allof_to_check_validation_semantics_request_body import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.api.post_api_endpoints.post_nested_anyof_to_check_validation_semantics_request_body import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.api.post_api_endpoints.post_nested_items_request_body import PostNestedItemsRequestBody +from unit_test_api.api.post_api_endpoints.post_nested_oneof_to_check_validation_semantics_request_body import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.api.post_api_endpoints.post_not_more_complex_schema_request_body import PostNotMoreComplexSchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_not_request_body import PostNotRequestBody +from unit_test_api.api.post_api_endpoints.post_nul_characters_in_strings_request_body import PostNulCharactersInStringsRequestBody +from unit_test_api.api.post_api_endpoints.post_null_type_matches_only_the_null_object_request_body import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.api.post_api_endpoints.post_number_type_matches_numbers_request_body import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.api.post_api_endpoints.post_object_properties_validation_request_body import PostObjectPropertiesValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_object_type_matches_objects_request_body import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.api.post_api_endpoints.post_oneof_complex_types_request_body import PostOneofComplexTypesRequestBody +from unit_test_api.api.post_api_endpoints.post_oneof_request_body import PostOneofRequestBody +from unit_test_api.api.post_api_endpoints.post_oneof_with_base_schema_request_body import PostOneofWithBaseSchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_oneof_with_empty_schema_request_body import PostOneofWithEmptySchemaRequestBody +from unit_test_api.api.post_api_endpoints.post_pattern_is_not_anchored_request_body import PostPatternIsNotAnchoredRequestBody +from unit_test_api.api.post_api_endpoints.post_pattern_validation_request_body import PostPatternValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_properties_with_escaped_characters_request_body import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.api.post_api_endpoints.post_property_named_ref_that_is_not_a_reference_request_body import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_additionalproperties_request_body import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_allof_request_body import PostRefInAllofRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_anyof_request_body import PostRefInAnyofRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_items_request_body import PostRefInItemsRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_oneof_request_body import PostRefInOneofRequestBody +from unit_test_api.api.post_api_endpoints.post_ref_in_property_request_body import PostRefInPropertyRequestBody +from unit_test_api.api.post_api_endpoints.post_required_default_validation_request_body import PostRequiredDefaultValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_required_validation_request_body import PostRequiredValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_required_with_empty_array_request_body import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.api.post_api_endpoints.post_simple_enum_validation_request_body import PostSimpleEnumValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_string_type_matches_strings_request_body import PostStringTypeMatchesStringsRequestBody +from unit_test_api.api.post_api_endpoints.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.api.post_api_endpoints.post_uniqueitems_false_validation_request_body import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_uniqueitems_validation_request_body import PostUniqueitemsValidationRequestBody +from unit_test_api.api.post_api_endpoints.post_uri_format_request_body import PostUriFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_uri_reference_format_request_body import PostUriReferenceFormatRequestBody +from unit_test_api.api.post_api_endpoints.post_uri_template_format_request_body import PostUriTemplateFormatRequestBody + + +class PostApi( + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostAllofRequestBody, + PostAllofSimpleTypesRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostAllofWithTheLastEmptySchemaRequestBody, + PostAllofWithTwoEmptySchemasRequestBody, + PostAnyofComplexTypesRequestBody, + PostAnyofRequestBody, + PostAnyofWithBaseSchemaRequestBody, + PostAnyofWithOneEmptySchemaRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostBooleanTypeMatchesBooleansRequestBody, + PostByIntRequestBody, + PostByNumberRequestBody, + PostBySmallNumberRequestBody, + PostDateTimeFormatRequestBody, + PostEmailFormatRequestBody, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostEnumsInPropertiesRequestBody, + PostForbiddenPropertyRequestBody, + PostHostnameFormatRequestBody, + PostIntegerTypeMatchesIntegersRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostInvalidStringValueForDefaultRequestBody, + PostIpv4FormatRequestBody, + PostIpv6FormatRequestBody, + PostJsonPointerFormatRequestBody, + PostMaximumValidationRequestBody, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostMaxitemsValidationRequestBody, + PostMaxlengthValidationRequestBody, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostMaxpropertiesValidationRequestBody, + PostMinimumValidationRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostMinitemsValidationRequestBody, + PostMinlengthValidationRequestBody, + PostMinpropertiesValidationRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostNestedItemsRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostNotMoreComplexSchemaRequestBody, + PostNotRequestBody, + PostNulCharactersInStringsRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostObjectPropertiesValidationRequestBody, + PostObjectTypeMatchesObjectsRequestBody, + PostOneofComplexTypesRequestBody, + PostOneofRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostOneofWithEmptySchemaRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostPatternValidationRequestBody, + PostPropertiesWithEscapedCharactersRequestBody, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostRefInAdditionalpropertiesRequestBody, + PostRefInAllofRequestBody, + PostRefInAnyofRequestBody, + PostRefInItemsRequestBody, + PostRefInOneofRequestBody, + PostRefInPropertyRequestBody, + PostRequiredDefaultValidationRequestBody, + PostRequiredValidationRequestBody, + PostRequiredWithEmptyArrayRequestBody, + PostSimpleEnumValidationRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostUniqueitemsValidationRequestBody, + PostUriFormatRequestBody, + PostUriReferenceFormatRequestBody, + PostUriTemplateFormatRequestBody, + ApiClient, +): + """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/api/post_api_endpoints/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/__init__.py new file mode 100644 index 00000000000..01b747df437 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.api.post_api import PostApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py new file mode 100644 index 00000000000..74eb180d682 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate + + +request_body_additionalproperties_allows_a_schema_which_should_validate = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(api_client.Api): + + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_allows_a_schema_which_should_validate.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py new file mode 100644 index 00000000000..152dd761193 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault + + +request_body_additionalproperties_are_allowed_by_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(api_client.Api): + + def post_additionalproperties_are_allowed_by_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_are_allowed_by_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py new file mode 100644 index 00000000000..06d4f848703 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself + + +request_body_additionalproperties_can_exist_by_itself = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesCanExistByItselfRequestBody(api_client.Api): + + def post_additionalproperties_can_exist_by_itself_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_can_exist_by_itself.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py new file mode 100644 index 00000000000..e2124b4819a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators + + +request_body_additionalproperties_should_not_look_in_applicators = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(api_client.Api): + + def post_additionalproperties_should_not_look_in_applicators_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_should_not_look_in_applicators.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py new file mode 100644 index 00000000000..8225f31a357 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof + +# body param +SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof + + +request_body_allof_combined_with_anyof_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofCombinedWithAnyofOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofCombinedWithAnyofOneofRequestBody(api_client.Api): + + def post_allof_combined_with_anyof_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_combined_with_anyof_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_request_body.py new file mode 100644 index 00000000000..a21978a91ad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof import Allof + +# body param +SchemaForRequestBodyApplicationJson = Allof + + +request_body_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofRequestBody(api_client.Api): + + def post_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_simple_types_request_body.py new file mode 100644 index 00000000000..ff3435c1aec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_simple_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_simple_types import AllofSimpleTypes + +# body param +SchemaForRequestBodyApplicationJson = AllofSimpleTypes + + +request_body_allof_simple_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofSimpleTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofSimpleTypesRequestBody(api_client.Api): + + def post_allof_simple_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_simple_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_base_schema_request_body.py new file mode 100644 index 00000000000..080eb4703ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithBaseSchema + + +request_body_allof_with_base_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithBaseSchemaRequestBody(api_client.Api): + + def post_allof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_base_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..2d47e3831d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema + + +request_body_allof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py new file mode 100644 index 00000000000..7b9ad71e9d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema + + +request_body_allof_with_the_first_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheFirstEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_first_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_first_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py new file mode 100644 index 00000000000..a7e1aec6d44 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema + + +request_body_allof_with_the_last_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheLastEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheLastEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_last_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_last_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_two_empty_schemas_request_body.py new file mode 100644 index 00000000000..f45409101b2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_allof_with_two_empty_schemas_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas + + +request_body_allof_with_two_empty_schemas = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTwoEmptySchemasRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTwoEmptySchemasRequestBody(api_client.Api): + + def post_allof_with_two_empty_schemas_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_two_empty_schemas.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_complex_types_request_body.py new file mode 100644 index 00000000000..a5a041b43af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = AnyofComplexTypes + + +request_body_anyof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofComplexTypesRequestBody(api_client.Api): + + def post_anyof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_request_body.py new file mode 100644 index 00000000000..4b7d8568b30 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof import Anyof + +# body param +SchemaForRequestBodyApplicationJson = Anyof + + +request_body_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofRequestBody(api_client.Api): + + def post_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_base_schema_request_body.py new file mode 100644 index 00000000000..27d7ade8535 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithBaseSchemaRequestBody(api_client.Api): + + def post_anyof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..18d0ceb7a2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_anyof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema + + +request_body_anyof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_anyof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_array_type_matches_arrays_request_body.py new file mode 100644 index 00000000000..57dd448efff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_array_type_matches_arrays_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays + +# body param +SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays + + +request_body_array_type_matches_arrays = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postArrayTypeMatchesArraysRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostArrayTypeMatchesArraysRequestBody(api_client.Api): + + def post_array_type_matches_arrays_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_array_type_matches_arrays.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_boolean_type_matches_booleans_request_body.py new file mode 100644 index 00000000000..eabe24adecf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_boolean_type_matches_booleans_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = BoolSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBooleanTypeMatchesBooleansRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBooleanTypeMatchesBooleansRequestBody(api_client.Api): + + def post_boolean_type_matches_booleans_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_int_request_body.py new file mode 100644 index 00000000000..90071628eaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_int_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_int import ByInt + +# body param +SchemaForRequestBodyApplicationJson = ByInt + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByIntRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByIntRequestBody(api_client.Api): + + def post_by_int_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_number_request_body.py new file mode 100644 index 00000000000..b1be0348fc5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_number import ByNumber + +# body param +SchemaForRequestBodyApplicationJson = ByNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByNumberRequestBody(api_client.Api): + + def post_by_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_small_number_request_body.py new file mode 100644 index 00000000000..5931bf8dd72 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_by_small_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_small_number import BySmallNumber + +# body param +SchemaForRequestBodyApplicationJson = BySmallNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBySmallNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBySmallNumberRequestBody(api_client.Api): + + def post_by_small_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_date_time_format_request_body.py new file mode 100644 index 00000000000..811f0300ec8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_date_time_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postDateTimeFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostDateTimeFormatRequestBody(api_client.Api): + + def post_date_time_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_email_format_request_body.py new file mode 100644 index 00000000000..2e1fa2846a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_email_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEmailFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEmailFormatRequestBody(api_client.Api): + + def post_email_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with0_does_not_match_false_request_body.py new file mode 100644 index 00000000000..dcb00bc5fbd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with0_does_not_match_false_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse + +# body param +SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith0DoesNotMatchFalseRequestBody(api_client.Api): + + def post_enum_with0_does_not_match_false_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with1_does_not_match_true_request_body.py new file mode 100644 index 00000000000..7c2bdecbcc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with1_does_not_match_true_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue + +# body param +SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith1DoesNotMatchTrueRequestBody(api_client.Api): + + def post_enum_with1_does_not_match_true_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..6f6d235b1e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithEscapedCharactersRequestBody(api_client.Api): + + def post_enum_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_false_does_not_match0_request_body.py new file mode 100644 index 00000000000..8a7a03b2a95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_false_does_not_match0_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithFalseDoesNotMatch0RequestBody(api_client.Api): + + def post_enum_with_false_does_not_match0_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_true_does_not_match1_request_body.py new file mode 100644 index 00000000000..7242ce845f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enum_with_true_does_not_match1_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithTrueDoesNotMatch1RequestBody(api_client.Api): + + def post_enum_with_true_does_not_match1_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enums_in_properties_request_body.py new file mode 100644 index 00000000000..d06295fff6e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_enums_in_properties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enums_in_properties import EnumsInProperties + +# body param +SchemaForRequestBodyApplicationJson = EnumsInProperties + + +request_body_enums_in_properties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumsInPropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumsInPropertiesRequestBody(api_client.Api): + + def post_enums_in_properties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_enums_in_properties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_forbidden_property_request_body.py new file mode 100644 index 00000000000..0fdb8617e74 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_forbidden_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.forbidden_property import ForbiddenProperty + +# body param +SchemaForRequestBodyApplicationJson = ForbiddenProperty + + +request_body_forbidden_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postForbiddenPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostForbiddenPropertyRequestBody(api_client.Api): + + def post_forbidden_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_forbidden_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_hostname_format_request_body.py new file mode 100644 index 00000000000..482b8e4f91a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_hostname_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postHostnameFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostHostnameFormatRequestBody(api_client.Api): + + def post_hostname_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_integer_type_matches_integers_request_body.py new file mode 100644 index 00000000000..6c7d7d4652d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_integer_type_matches_integers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = IntSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIntegerTypeMatchesIntegersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIntegerTypeMatchesIntegersRequestBody(api_client.Api): + + def post_integer_type_matches_integers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py new file mode 100644 index 00000000000..1141ec8135f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + +# body param +SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(api_client.Api): + + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_string_value_for_default_request_body.py new file mode 100644 index 00000000000..072cdeff98a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_invalid_string_value_for_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault + +# body param +SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault + + +request_body_invalid_string_value_for_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidStringValueForDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidStringValueForDefaultRequestBody(api_client.Api): + + def post_invalid_string_value_for_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_invalid_string_value_for_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv4_format_request_body.py new file mode 100644 index 00000000000..4504a5cf7bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv4_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv4FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv4FormatRequestBody(api_client.Api): + + def post_ipv4_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv6_format_request_body.py new file mode 100644 index 00000000000..e1f7572a6cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ipv6_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv6FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv6FormatRequestBody(api_client.Api): + + def post_ipv6_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_json_pointer_format_request_body.py new file mode 100644 index 00000000000..d24cb5c5db0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_json_pointer_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postJsonPointerFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostJsonPointerFormatRequestBody(api_client.Api): + + def post_json_pointer_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_request_body.py new file mode 100644 index 00000000000..d79c50215fa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation import MaximumValidation + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationRequestBody(api_client.Api): + + def post_maximum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py new file mode 100644 index 00000000000..67b5b06f2e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationWithUnsignedIntegerRequestBody(api_client.Api): + + def post_maximum_validation_with_unsigned_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxitems_validation_request_body.py new file mode 100644 index 00000000000..573edabf721 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxitems_validation import MaxitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxitemsValidationRequestBody(api_client.Api): + + def post_maxitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxlength_validation_request_body.py new file mode 100644 index 00000000000..5165e6a4263 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxlength_validation import MaxlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxlengthValidationRequestBody(api_client.Api): + + def post_maxlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py new file mode 100644 index 00000000000..2c40a104afc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty + +# body param +SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(api_client.Api): + + def post_maxproperties0_means_the_object_is_empty_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties_validation_request_body.py new file mode 100644 index 00000000000..9ebc80bff90 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_maxproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxpropertiesValidationRequestBody(api_client.Api): + + def post_maxproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_request_body.py new file mode 100644 index 00000000000..f191aee2072 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation import MinimumValidation + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationRequestBody(api_client.Api): + + def post_minimum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py new file mode 100644 index 00000000000..5ca6f649c60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationWithSignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationWithSignedIntegerRequestBody(api_client.Api): + + def post_minimum_validation_with_signed_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minitems_validation_request_body.py new file mode 100644 index 00000000000..b7f9e9b45f3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minitems_validation import MinitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MinitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinitemsValidationRequestBody(api_client.Api): + + def post_minitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minlength_validation_request_body.py new file mode 100644 index 00000000000..9fbc87a18a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minlength_validation import MinlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MinlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinlengthValidationRequestBody(api_client.Api): + + def post_minlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minproperties_validation_request_body.py new file mode 100644 index 00000000000..330e6561079 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_minproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minproperties_validation import MinpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MinpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinpropertiesValidationRequestBody(api_client.Api): + + def post_minproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..be5eeac206e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics + + +request_body_nested_allof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAllofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_allof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_allof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..c5d6520fc58 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics + + +request_body_nested_anyof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAnyofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_anyof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_anyof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_items_request_body.py new file mode 100644 index 00000000000..a6439bb5618 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_items import NestedItems + +# body param +SchemaForRequestBodyApplicationJson = NestedItems + + +request_body_nested_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedItemsRequestBody(api_client.Api): + + def post_nested_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..e919dd40de6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics + + +request_body_nested_oneof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedOneofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_oneof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_oneof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_more_complex_schema_request_body.py new file mode 100644 index 00000000000..cca040f3496 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_more_complex_schema_request_body.py @@ -0,0 +1,216 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + + + class NotSchema( + DictSchema + ): + foo = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + foo: typing.Union[foo, Unset] = unset, + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'NotSchema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotMoreComplexSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotMoreComplexSchemaRequestBody(api_client.Api): + + def post_not_more_complex_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_request_body.py new file mode 100644 index 00000000000..26a993683de --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_not_request_body.py @@ -0,0 +1,195 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + NotSchema = IntSchema + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotRequestBody(api_client.Api): + + def post_not_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nul_characters_in_strings_request_body.py new file mode 100644 index 00000000000..0cd4f2b03c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_nul_characters_in_strings_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings + +# body param +SchemaForRequestBodyApplicationJson = NulCharactersInStrings + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNulCharactersInStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNulCharactersInStringsRequestBody(api_client.Api): + + def post_nul_characters_in_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py new file mode 100644 index 00000000000..bbe9c2529ae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NoneSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNullTypeMatchesOnlyTheNullObjectRequestBody(api_client.Api): + + def post_null_type_matches_only_the_null_object_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_number_type_matches_numbers_request_body.py new file mode 100644 index 00000000000..8bdc5593dd8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_number_type_matches_numbers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NumberSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNumberTypeMatchesNumbersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNumberTypeMatchesNumbersRequestBody(api_client.Api): + + def post_number_type_matches_numbers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_properties_validation_request_body.py new file mode 100644 index 00000000000..bf67f4e981f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_properties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation + + +request_body_object_properties_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectPropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectPropertiesValidationRequestBody(api_client.Api): + + def post_object_properties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_object_properties_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_type_matches_objects_request_body.py new file mode 100644 index 00000000000..8ecca92de95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_object_type_matches_objects_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = DictSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectTypeMatchesObjectsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectTypeMatchesObjectsRequestBody(api_client.Api): + + def post_object_type_matches_objects_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_complex_types_request_body.py new file mode 100644 index 00000000000..04cfec2d09d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_complex_types import OneofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = OneofComplexTypes + + +request_body_oneof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofComplexTypesRequestBody(api_client.Api): + + def post_oneof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_request_body.py new file mode 100644 index 00000000000..5385a8c94d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof import Oneof + +# body param +SchemaForRequestBodyApplicationJson = Oneof + + +request_body_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofRequestBody(api_client.Api): + + def post_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_base_schema_request_body.py new file mode 100644 index 00000000000..fb23d0bcfdd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithBaseSchemaRequestBody(api_client.Api): + + def post_oneof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_empty_schema_request_body.py new file mode 100644 index 00000000000..95edbc98a65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_oneof_with_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithEmptySchema + + +request_body_oneof_with_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithEmptySchemaRequestBody(api_client.Api): + + def post_oneof_with_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_with_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_is_not_anchored_request_body.py new file mode 100644 index 00000000000..3a2a7b18b84 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_is_not_anchored_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored + +# body param +SchemaForRequestBodyApplicationJson = PatternIsNotAnchored + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternIsNotAnchoredRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternIsNotAnchoredRequestBody(api_client.Api): + + def post_pattern_is_not_anchored_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_validation_request_body.py new file mode 100644 index 00000000000..1e8900bac1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_pattern_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_validation import PatternValidation + +# body param +SchemaForRequestBodyApplicationJson = PatternValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternValidationRequestBody(api_client.Api): + + def post_pattern_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_properties_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..02efabfe995 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_properties_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters + + +request_body_properties_with_escaped_characters = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertiesWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertiesWithEscapedCharactersRequestBody(api_client.Api): + + def post_properties_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_properties_with_escaped_characters.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py new file mode 100644 index 00000000000..2a0f5a933d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference + +# body param +SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference + + +request_body_property_named_ref_that_is_not_a_reference = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertyNamedRefThatIsNotAReferenceRequestBody(api_client.Api): + + def post_property_named_ref_that_is_not_a_reference_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_property_named_ref_that_is_not_a_reference.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_additionalproperties_request_body.py new file mode 100644 index 00000000000..95a5e59a87f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_additionalproperties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties + +# body param +SchemaForRequestBodyApplicationJson = RefInAdditionalproperties + + +request_body_ref_in_additionalproperties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAdditionalpropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAdditionalpropertiesRequestBody(api_client.Api): + + def post_ref_in_additionalproperties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_additionalproperties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_allof_request_body.py new file mode 100644 index 00000000000..d574a98686e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_allof import RefInAllof + +# body param +SchemaForRequestBodyApplicationJson = RefInAllof + + +request_body_ref_in_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAllofRequestBody(api_client.Api): + + def post_ref_in_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_anyof_request_body.py new file mode 100644 index 00000000000..8a02d33492b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_anyof import RefInAnyof + +# body param +SchemaForRequestBodyApplicationJson = RefInAnyof + + +request_body_ref_in_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAnyofRequestBody(api_client.Api): + + def post_ref_in_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_items_request_body.py new file mode 100644 index 00000000000..8fe32a023d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_items import RefInItems + +# body param +SchemaForRequestBodyApplicationJson = RefInItems + + +request_body_ref_in_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInItemsRequestBody(api_client.Api): + + def post_ref_in_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_oneof_request_body.py new file mode 100644 index 00000000000..73c2d4e9680 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_oneof import RefInOneof + +# body param +SchemaForRequestBodyApplicationJson = RefInOneof + + +request_body_ref_in_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInOneofRequestBody(api_client.Api): + + def post_ref_in_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_property_request_body.py new file mode 100644 index 00000000000..10a31753244 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_ref_in_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_property import RefInProperty + +# body param +SchemaForRequestBodyApplicationJson = RefInProperty + + +request_body_ref_in_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInPropertyRequestBody(api_client.Api): + + def post_ref_in_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_default_validation_request_body.py new file mode 100644 index 00000000000..7059686bfa3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_default_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_default_validation import RequiredDefaultValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredDefaultValidation + + +request_body_required_default_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredDefaultValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredDefaultValidationRequestBody(api_client.Api): + + def post_required_default_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_default_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_validation_request_body.py new file mode 100644 index 00000000000..1cd7d8cf296 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_validation import RequiredValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredValidation + + +request_body_required_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredValidationRequestBody(api_client.Api): + + def post_required_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_with_empty_array_request_body.py new file mode 100644 index 00000000000..6bf34d75b60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_required_with_empty_array_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray + +# body param +SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray + + +request_body_required_with_empty_array = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredWithEmptyArrayRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredWithEmptyArrayRequestBody(api_client.Api): + + def post_required_with_empty_array_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_with_empty_array.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_simple_enum_validation_request_body.py new file mode 100644 index 00000000000..af46c1f8580 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_simple_enum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation + +# body param +SchemaForRequestBodyApplicationJson = SimpleEnumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postSimpleEnumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostSimpleEnumValidationRequestBody(api_client.Api): + + def post_simple_enum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_string_type_matches_strings_request_body.py new file mode 100644 index 00000000000..704d093b41a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_string_type_matches_strings_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postStringTypeMatchesStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostStringTypeMatchesStringsRequestBody(api_client.Api): + + def post_string_type_matches_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py new file mode 100644 index 00000000000..3feabb524b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + +# body param +SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + + +request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(api_client.Api): + + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_false_validation_request_body.py new file mode 100644 index 00000000000..6f048e4f347 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_false_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsFalseValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsFalseValidationRequestBody(api_client.Api): + + def post_uniqueitems_false_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_validation_request_body.py new file mode 100644 index 00000000000..09d4d4c710e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uniqueitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsValidationRequestBody(api_client.Api): + + def post_uniqueitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_format_request_body.py new file mode 100644 index 00000000000..84f6c8e7adc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriFormatRequestBody(api_client.Api): + + def post_uri_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_reference_format_request_body.py new file mode 100644 index 00000000000..8b2935bd02e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_reference_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriReferenceFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriReferenceFormatRequestBody(api_client.Api): + + def post_uri_reference_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_template_format_request_body.py new file mode 100644 index 00000000000..352ea7ebdc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/post_api_endpoints/post_uri_template_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriTemplateFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriTemplateFormatRequestBody(api_client.Api): + + def post_uri_template_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api.py new file mode 100644 index 00000000000..e675e31147c --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api.py @@ -0,0 +1,191 @@ +# 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 +""" + +from unit_test_api.api_client import ApiClient +from unit_test_api.api.request_body_api_endpoints.post_additionalproperties_allows_a_schema_which_should_validate_request_body import PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody +from unit_test_api.api.request_body_api_endpoints.post_additionalproperties_are_allowed_by_default_request_body import PostAdditionalpropertiesAreAllowedByDefaultRequestBody +from unit_test_api.api.request_body_api_endpoints.post_additionalproperties_can_exist_by_itself_request_body import PostAdditionalpropertiesCanExistByItselfRequestBody +from unit_test_api.api.request_body_api_endpoints.post_additionalproperties_should_not_look_in_applicators_request_body import PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_combined_with_anyof_oneof_request_body import PostAllofCombinedWithAnyofOneofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_request_body import PostAllofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_simple_types_request_body import PostAllofSimpleTypesRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_with_base_schema_request_body import PostAllofWithBaseSchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_with_one_empty_schema_request_body import PostAllofWithOneEmptySchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_with_the_first_empty_schema_request_body import PostAllofWithTheFirstEmptySchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_with_the_last_empty_schema_request_body import PostAllofWithTheLastEmptySchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_allof_with_two_empty_schemas_request_body import PostAllofWithTwoEmptySchemasRequestBody +from unit_test_api.api.request_body_api_endpoints.post_anyof_complex_types_request_body import PostAnyofComplexTypesRequestBody +from unit_test_api.api.request_body_api_endpoints.post_anyof_request_body import PostAnyofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_anyof_with_base_schema_request_body import PostAnyofWithBaseSchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_anyof_with_one_empty_schema_request_body import PostAnyofWithOneEmptySchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_array_type_matches_arrays_request_body import PostArrayTypeMatchesArraysRequestBody +from unit_test_api.api.request_body_api_endpoints.post_boolean_type_matches_booleans_request_body import PostBooleanTypeMatchesBooleansRequestBody +from unit_test_api.api.request_body_api_endpoints.post_by_int_request_body import PostByIntRequestBody +from unit_test_api.api.request_body_api_endpoints.post_by_number_request_body import PostByNumberRequestBody +from unit_test_api.api.request_body_api_endpoints.post_by_small_number_request_body import PostBySmallNumberRequestBody +from unit_test_api.api.request_body_api_endpoints.post_date_time_format_request_body import PostDateTimeFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_email_format_request_body import PostEmailFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_enum_with0_does_not_match_false_request_body import PostEnumWith0DoesNotMatchFalseRequestBody +from unit_test_api.api.request_body_api_endpoints.post_enum_with1_does_not_match_true_request_body import PostEnumWith1DoesNotMatchTrueRequestBody +from unit_test_api.api.request_body_api_endpoints.post_enum_with_escaped_characters_request_body import PostEnumWithEscapedCharactersRequestBody +from unit_test_api.api.request_body_api_endpoints.post_enum_with_false_does_not_match0_request_body import PostEnumWithFalseDoesNotMatch0RequestBody +from unit_test_api.api.request_body_api_endpoints.post_enum_with_true_does_not_match1_request_body import PostEnumWithTrueDoesNotMatch1RequestBody +from unit_test_api.api.request_body_api_endpoints.post_enums_in_properties_request_body import PostEnumsInPropertiesRequestBody +from unit_test_api.api.request_body_api_endpoints.post_forbidden_property_request_body import PostForbiddenPropertyRequestBody +from unit_test_api.api.request_body_api_endpoints.post_hostname_format_request_body import PostHostnameFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_integer_type_matches_integers_request_body import PostIntegerTypeMatchesIntegersRequestBody +from unit_test_api.api.request_body_api_endpoints.post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body import PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody +from unit_test_api.api.request_body_api_endpoints.post_invalid_string_value_for_default_request_body import PostInvalidStringValueForDefaultRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ipv4_format_request_body import PostIpv4FormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ipv6_format_request_body import PostIpv6FormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_json_pointer_format_request_body import PostJsonPointerFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maximum_validation_request_body import PostMaximumValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maximum_validation_with_unsigned_integer_request_body import PostMaximumValidationWithUnsignedIntegerRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maxitems_validation_request_body import PostMaxitemsValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maxlength_validation_request_body import PostMaxlengthValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maxproperties0_means_the_object_is_empty_request_body import PostMaxproperties0MeansTheObjectIsEmptyRequestBody +from unit_test_api.api.request_body_api_endpoints.post_maxproperties_validation_request_body import PostMaxpropertiesValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_minimum_validation_request_body import PostMinimumValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_minimum_validation_with_signed_integer_request_body import PostMinimumValidationWithSignedIntegerRequestBody +from unit_test_api.api.request_body_api_endpoints.post_minitems_validation_request_body import PostMinitemsValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_minlength_validation_request_body import PostMinlengthValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_minproperties_validation_request_body import PostMinpropertiesValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_nested_allof_to_check_validation_semantics_request_body import PostNestedAllofToCheckValidationSemanticsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_nested_anyof_to_check_validation_semantics_request_body import PostNestedAnyofToCheckValidationSemanticsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_nested_items_request_body import PostNestedItemsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_nested_oneof_to_check_validation_semantics_request_body import PostNestedOneofToCheckValidationSemanticsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_not_more_complex_schema_request_body import PostNotMoreComplexSchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_not_request_body import PostNotRequestBody +from unit_test_api.api.request_body_api_endpoints.post_nul_characters_in_strings_request_body import PostNulCharactersInStringsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_null_type_matches_only_the_null_object_request_body import PostNullTypeMatchesOnlyTheNullObjectRequestBody +from unit_test_api.api.request_body_api_endpoints.post_number_type_matches_numbers_request_body import PostNumberTypeMatchesNumbersRequestBody +from unit_test_api.api.request_body_api_endpoints.post_object_properties_validation_request_body import PostObjectPropertiesValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_object_type_matches_objects_request_body import PostObjectTypeMatchesObjectsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_oneof_complex_types_request_body import PostOneofComplexTypesRequestBody +from unit_test_api.api.request_body_api_endpoints.post_oneof_request_body import PostOneofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_oneof_with_base_schema_request_body import PostOneofWithBaseSchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_oneof_with_empty_schema_request_body import PostOneofWithEmptySchemaRequestBody +from unit_test_api.api.request_body_api_endpoints.post_pattern_is_not_anchored_request_body import PostPatternIsNotAnchoredRequestBody +from unit_test_api.api.request_body_api_endpoints.post_pattern_validation_request_body import PostPatternValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_properties_with_escaped_characters_request_body import PostPropertiesWithEscapedCharactersRequestBody +from unit_test_api.api.request_body_api_endpoints.post_property_named_ref_that_is_not_a_reference_request_body import PostPropertyNamedRefThatIsNotAReferenceRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_additionalproperties_request_body import PostRefInAdditionalpropertiesRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_allof_request_body import PostRefInAllofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_anyof_request_body import PostRefInAnyofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_items_request_body import PostRefInItemsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_oneof_request_body import PostRefInOneofRequestBody +from unit_test_api.api.request_body_api_endpoints.post_ref_in_property_request_body import PostRefInPropertyRequestBody +from unit_test_api.api.request_body_api_endpoints.post_required_default_validation_request_body import PostRequiredDefaultValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_required_validation_request_body import PostRequiredValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_required_with_empty_array_request_body import PostRequiredWithEmptyArrayRequestBody +from unit_test_api.api.request_body_api_endpoints.post_simple_enum_validation_request_body import PostSimpleEnumValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_string_type_matches_strings_request_body import PostStringTypeMatchesStringsRequestBody +from unit_test_api.api.request_body_api_endpoints.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody +from unit_test_api.api.request_body_api_endpoints.post_uniqueitems_false_validation_request_body import PostUniqueitemsFalseValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_uniqueitems_validation_request_body import PostUniqueitemsValidationRequestBody +from unit_test_api.api.request_body_api_endpoints.post_uri_format_request_body import PostUriFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_uri_reference_format_request_body import PostUriReferenceFormatRequestBody +from unit_test_api.api.request_body_api_endpoints.post_uri_template_format_request_body import PostUriTemplateFormatRequestBody + + +class RequestBodyApi( + PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody, + PostAdditionalpropertiesAreAllowedByDefaultRequestBody, + PostAdditionalpropertiesCanExistByItselfRequestBody, + PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody, + PostAllofCombinedWithAnyofOneofRequestBody, + PostAllofRequestBody, + PostAllofSimpleTypesRequestBody, + PostAllofWithBaseSchemaRequestBody, + PostAllofWithOneEmptySchemaRequestBody, + PostAllofWithTheFirstEmptySchemaRequestBody, + PostAllofWithTheLastEmptySchemaRequestBody, + PostAllofWithTwoEmptySchemasRequestBody, + PostAnyofComplexTypesRequestBody, + PostAnyofRequestBody, + PostAnyofWithBaseSchemaRequestBody, + PostAnyofWithOneEmptySchemaRequestBody, + PostArrayTypeMatchesArraysRequestBody, + PostBooleanTypeMatchesBooleansRequestBody, + PostByIntRequestBody, + PostByNumberRequestBody, + PostBySmallNumberRequestBody, + PostDateTimeFormatRequestBody, + PostEmailFormatRequestBody, + PostEnumWith0DoesNotMatchFalseRequestBody, + PostEnumWith1DoesNotMatchTrueRequestBody, + PostEnumWithEscapedCharactersRequestBody, + PostEnumWithFalseDoesNotMatch0RequestBody, + PostEnumWithTrueDoesNotMatch1RequestBody, + PostEnumsInPropertiesRequestBody, + PostForbiddenPropertyRequestBody, + PostHostnameFormatRequestBody, + PostIntegerTypeMatchesIntegersRequestBody, + PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody, + PostInvalidStringValueForDefaultRequestBody, + PostIpv4FormatRequestBody, + PostIpv6FormatRequestBody, + PostJsonPointerFormatRequestBody, + PostMaximumValidationRequestBody, + PostMaximumValidationWithUnsignedIntegerRequestBody, + PostMaxitemsValidationRequestBody, + PostMaxlengthValidationRequestBody, + PostMaxproperties0MeansTheObjectIsEmptyRequestBody, + PostMaxpropertiesValidationRequestBody, + PostMinimumValidationRequestBody, + PostMinimumValidationWithSignedIntegerRequestBody, + PostMinitemsValidationRequestBody, + PostMinlengthValidationRequestBody, + PostMinpropertiesValidationRequestBody, + PostNestedAllofToCheckValidationSemanticsRequestBody, + PostNestedAnyofToCheckValidationSemanticsRequestBody, + PostNestedItemsRequestBody, + PostNestedOneofToCheckValidationSemanticsRequestBody, + PostNotMoreComplexSchemaRequestBody, + PostNotRequestBody, + PostNulCharactersInStringsRequestBody, + PostNullTypeMatchesOnlyTheNullObjectRequestBody, + PostNumberTypeMatchesNumbersRequestBody, + PostObjectPropertiesValidationRequestBody, + PostObjectTypeMatchesObjectsRequestBody, + PostOneofComplexTypesRequestBody, + PostOneofRequestBody, + PostOneofWithBaseSchemaRequestBody, + PostOneofWithEmptySchemaRequestBody, + PostPatternIsNotAnchoredRequestBody, + PostPatternValidationRequestBody, + PostPropertiesWithEscapedCharactersRequestBody, + PostPropertyNamedRefThatIsNotAReferenceRequestBody, + PostRefInAdditionalpropertiesRequestBody, + PostRefInAllofRequestBody, + PostRefInAnyofRequestBody, + PostRefInItemsRequestBody, + PostRefInOneofRequestBody, + PostRefInPropertyRequestBody, + PostRequiredDefaultValidationRequestBody, + PostRequiredValidationRequestBody, + PostRequiredWithEmptyArrayRequestBody, + PostSimpleEnumValidationRequestBody, + PostStringTypeMatchesStringsRequestBody, + PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody, + PostUniqueitemsFalseValidationRequestBody, + PostUniqueitemsValidationRequestBody, + PostUriFormatRequestBody, + PostUriReferenceFormatRequestBody, + PostUriTemplateFormatRequestBody, + ApiClient, +): + """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/api/request_body_api_endpoints/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/__init__.py new file mode 100644 index 00000000000..155bdf9976d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from unit_test_api.api.request_body_api import RequestBodyApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py new file mode 100644 index 00000000000..74eb180d682 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_allows_a_schema_which_should_validate_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAllowsASchemaWhichShouldValidate + + +request_body_additionalproperties_allows_a_schema_which_should_validate = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(api_client.Api): + + def post_additionalproperties_allows_a_schema_which_should_validate_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_allows_a_schema_which_should_validate.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py new file mode 100644 index 00000000000..152dd761193 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_are_allowed_by_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesAreAllowedByDefault + + +request_body_additionalproperties_are_allowed_by_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesAreAllowedByDefaultRequestBody(api_client.Api): + + def post_additionalproperties_are_allowed_by_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_are_allowed_by_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py new file mode 100644 index 00000000000..06d4f848703 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_can_exist_by_itself_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesCanExistByItself + + +request_body_additionalproperties_can_exist_by_itself = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesCanExistByItselfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesCanExistByItselfRequestBody(api_client.Api): + + def post_additionalproperties_can_exist_by_itself_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_can_exist_by_itself.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py new file mode 100644 index 00000000000..e2124b4819a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_additionalproperties_should_not_look_in_applicators_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators + +# body param +SchemaForRequestBodyApplicationJson = AdditionalpropertiesShouldNotLookInApplicators + + +request_body_additionalproperties_should_not_look_in_applicators = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAdditionalpropertiesShouldNotLookInApplicatorsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAdditionalpropertiesShouldNotLookInApplicatorsRequestBody(api_client.Api): + + def post_additionalproperties_should_not_look_in_applicators_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_additionalproperties_should_not_look_in_applicators.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py new file mode 100644 index 00000000000..8225f31a357 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_combined_with_anyof_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof + +# body param +SchemaForRequestBodyApplicationJson = AllofCombinedWithAnyofOneof + + +request_body_allof_combined_with_anyof_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofCombinedWithAnyofOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofCombinedWithAnyofOneofRequestBody(api_client.Api): + + def post_allof_combined_with_anyof_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_combined_with_anyof_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_request_body.py new file mode 100644 index 00000000000..a21978a91ad --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof import Allof + +# body param +SchemaForRequestBodyApplicationJson = Allof + + +request_body_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofRequestBody(api_client.Api): + + def post_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_simple_types_request_body.py new file mode 100644 index 00000000000..ff3435c1aec --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_simple_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_simple_types import AllofSimpleTypes + +# body param +SchemaForRequestBodyApplicationJson = AllofSimpleTypes + + +request_body_allof_simple_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofSimpleTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofSimpleTypesRequestBody(api_client.Api): + + def post_allof_simple_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_simple_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_base_schema_request_body.py new file mode 100644 index 00000000000..080eb4703ac --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_base_schema import AllofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithBaseSchema + + +request_body_allof_with_base_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithBaseSchemaRequestBody(api_client.Api): + + def post_allof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_base_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..2d47e3831d0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_one_empty_schema import AllofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithOneEmptySchema + + +request_body_allof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py new file mode 100644 index 00000000000..7b9ad71e9d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_first_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheFirstEmptySchema + + +request_body_allof_with_the_first_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheFirstEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheFirstEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_first_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_first_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py new file mode 100644 index 00000000000..a7e1aec6d44 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_the_last_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTheLastEmptySchema + + +request_body_allof_with_the_last_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTheLastEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTheLastEmptySchemaRequestBody(api_client.Api): + + def post_allof_with_the_last_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_the_last_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_two_empty_schemas_request_body.py new file mode 100644 index 00000000000..f45409101b2 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_allof_with_two_empty_schemas_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas + +# body param +SchemaForRequestBodyApplicationJson = AllofWithTwoEmptySchemas + + +request_body_allof_with_two_empty_schemas = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAllofWithTwoEmptySchemasRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAllofWithTwoEmptySchemasRequestBody(api_client.Api): + + def post_allof_with_two_empty_schemas_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_allof_with_two_empty_schemas.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_complex_types_request_body.py new file mode 100644 index 00000000000..a5a041b43af --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_complex_types import AnyofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = AnyofComplexTypes + + +request_body_anyof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofComplexTypesRequestBody(api_client.Api): + + def post_anyof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_request_body.py new file mode 100644 index 00000000000..4b7d8568b30 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof import Anyof + +# body param +SchemaForRequestBodyApplicationJson = Anyof + + +request_body_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofRequestBody(api_client.Api): + + def post_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_base_schema_request_body.py new file mode 100644 index 00000000000..27d7ade8535 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_base_schema import AnyofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithBaseSchemaRequestBody(api_client.Api): + + def post_anyof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_one_empty_schema_request_body.py new file mode 100644 index 00000000000..18d0ceb7a2f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_anyof_with_one_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.anyof_with_one_empty_schema import AnyofWithOneEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = AnyofWithOneEmptySchema + + +request_body_anyof_with_one_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postAnyofWithOneEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostAnyofWithOneEmptySchemaRequestBody(api_client.Api): + + def post_anyof_with_one_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_anyof_with_one_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_array_type_matches_arrays_request_body.py new file mode 100644 index 00000000000..57dd448efff --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_array_type_matches_arrays_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.array_type_matches_arrays import ArrayTypeMatchesArrays + +# body param +SchemaForRequestBodyApplicationJson = ArrayTypeMatchesArrays + + +request_body_array_type_matches_arrays = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postArrayTypeMatchesArraysRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostArrayTypeMatchesArraysRequestBody(api_client.Api): + + def post_array_type_matches_arrays_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_array_type_matches_arrays.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_boolean_type_matches_booleans_request_body.py new file mode 100644 index 00000000000..eabe24adecf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_boolean_type_matches_booleans_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = BoolSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBooleanTypeMatchesBooleansRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBooleanTypeMatchesBooleansRequestBody(api_client.Api): + + def post_boolean_type_matches_booleans_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_int_request_body.py new file mode 100644 index 00000000000..90071628eaf --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_int_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_int import ByInt + +# body param +SchemaForRequestBodyApplicationJson = ByInt + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByIntRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByIntRequestBody(api_client.Api): + + def post_by_int_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_number_request_body.py new file mode 100644 index 00000000000..b1be0348fc5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_number import ByNumber + +# body param +SchemaForRequestBodyApplicationJson = ByNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postByNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostByNumberRequestBody(api_client.Api): + + def post_by_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_small_number_request_body.py new file mode 100644 index 00000000000..5931bf8dd72 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_by_small_number_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.by_small_number import BySmallNumber + +# body param +SchemaForRequestBodyApplicationJson = BySmallNumber + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postBySmallNumberRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostBySmallNumberRequestBody(api_client.Api): + + def post_by_small_number_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_date_time_format_request_body.py new file mode 100644 index 00000000000..811f0300ec8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_date_time_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postDateTimeFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostDateTimeFormatRequestBody(api_client.Api): + + def post_date_time_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_email_format_request_body.py new file mode 100644 index 00000000000..2e1fa2846a9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_email_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEmailFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEmailFormatRequestBody(api_client.Api): + + def post_email_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with0_does_not_match_false_request_body.py new file mode 100644 index 00000000000..dcb00bc5fbd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with0_does_not_match_false_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse + +# body param +SchemaForRequestBodyApplicationJson = EnumWith0DoesNotMatchFalse + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith0DoesNotMatchFalseRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith0DoesNotMatchFalseRequestBody(api_client.Api): + + def post_enum_with0_does_not_match_false_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with1_does_not_match_true_request_body.py new file mode 100644 index 00000000000..7c2bdecbcc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with1_does_not_match_true_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue + +# body param +SchemaForRequestBodyApplicationJson = EnumWith1DoesNotMatchTrue + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWith1DoesNotMatchTrueRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWith1DoesNotMatchTrueRequestBody(api_client.Api): + + def post_enum_with1_does_not_match_true_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..6f6d235b1e6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_escaped_characters import EnumWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = EnumWithEscapedCharacters + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithEscapedCharactersRequestBody(api_client.Api): + + def post_enum_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_false_does_not_match0_request_body.py new file mode 100644 index 00000000000..8a7a03b2a95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_false_does_not_match0_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithFalseDoesNotMatch0 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithFalseDoesNotMatch0RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithFalseDoesNotMatch0RequestBody(api_client.Api): + + def post_enum_with_false_does_not_match0_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_true_does_not_match1_request_body.py new file mode 100644 index 00000000000..7242ce845f6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enum_with_true_does_not_match1_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 + +# body param +SchemaForRequestBodyApplicationJson = EnumWithTrueDoesNotMatch1 + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumWithTrueDoesNotMatch1RequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumWithTrueDoesNotMatch1RequestBody(api_client.Api): + + def post_enum_with_true_does_not_match1_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enums_in_properties_request_body.py new file mode 100644 index 00000000000..d06295fff6e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_enums_in_properties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.enums_in_properties import EnumsInProperties + +# body param +SchemaForRequestBodyApplicationJson = EnumsInProperties + + +request_body_enums_in_properties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postEnumsInPropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostEnumsInPropertiesRequestBody(api_client.Api): + + def post_enums_in_properties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_enums_in_properties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_forbidden_property_request_body.py new file mode 100644 index 00000000000..0fdb8617e74 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_forbidden_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.forbidden_property import ForbiddenProperty + +# body param +SchemaForRequestBodyApplicationJson = ForbiddenProperty + + +request_body_forbidden_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postForbiddenPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostForbiddenPropertyRequestBody(api_client.Api): + + def post_forbidden_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_forbidden_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_hostname_format_request_body.py new file mode 100644 index 00000000000..482b8e4f91a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_hostname_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postHostnameFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostHostnameFormatRequestBody(api_client.Api): + + def post_hostname_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_integer_type_matches_integers_request_body.py new file mode 100644 index 00000000000..6c7d7d4652d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_integer_type_matches_integers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = IntSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIntegerTypeMatchesIntegersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIntegerTypeMatchesIntegersRequestBody(api_client.Api): + + def post_integer_type_matches_integers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py new file mode 100644 index 00000000000..1141ec8135f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + +# body param +SchemaForRequestBodyApplicationJson = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfRequestBody(api_client.Api): + + def post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_string_value_for_default_request_body.py new file mode 100644 index 00000000000..072cdeff98a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_invalid_string_value_for_default_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.invalid_string_value_for_default import InvalidStringValueForDefault + +# body param +SchemaForRequestBodyApplicationJson = InvalidStringValueForDefault + + +request_body_invalid_string_value_for_default = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postInvalidStringValueForDefaultRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostInvalidStringValueForDefaultRequestBody(api_client.Api): + + def post_invalid_string_value_for_default_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_invalid_string_value_for_default.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv4_format_request_body.py new file mode 100644 index 00000000000..4504a5cf7bd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv4_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv4FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv4FormatRequestBody(api_client.Api): + + def post_ipv4_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv6_format_request_body.py new file mode 100644 index 00000000000..e1f7572a6cc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ipv6_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postIpv6FormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostIpv6FormatRequestBody(api_client.Api): + + def post_ipv6_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_json_pointer_format_request_body.py new file mode 100644 index 00000000000..d24cb5c5db0 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_json_pointer_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postJsonPointerFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostJsonPointerFormatRequestBody(api_client.Api): + + def post_json_pointer_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_request_body.py new file mode 100644 index 00000000000..d79c50215fa --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation import MaximumValidation + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationRequestBody(api_client.Api): + + def post_maximum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py new file mode 100644 index 00000000000..67b5b06f2e9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maximum_validation_with_unsigned_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MaximumValidationWithUnsignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaximumValidationWithUnsignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaximumValidationWithUnsignedIntegerRequestBody(api_client.Api): + + def post_maximum_validation_with_unsigned_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxitems_validation_request_body.py new file mode 100644 index 00000000000..573edabf721 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxitems_validation import MaxitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxitemsValidationRequestBody(api_client.Api): + + def post_maxitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxlength_validation_request_body.py new file mode 100644 index 00000000000..5165e6a4263 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxlength_validation import MaxlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxlengthValidationRequestBody(api_client.Api): + + def post_maxlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py new file mode 100644 index 00000000000..2c40a104afc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties0_means_the_object_is_empty_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty + +# body param +SchemaForRequestBodyApplicationJson = Maxproperties0MeansTheObjectIsEmpty + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxproperties0MeansTheObjectIsEmptyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxproperties0MeansTheObjectIsEmptyRequestBody(api_client.Api): + + def post_maxproperties0_means_the_object_is_empty_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties_validation_request_body.py new file mode 100644 index 00000000000..9ebc80bff90 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_maxproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.maxproperties_validation import MaxpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MaxpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMaxpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMaxpropertiesValidationRequestBody(api_client.Api): + + def post_maxproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_request_body.py new file mode 100644 index 00000000000..f191aee2072 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation import MinimumValidation + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationRequestBody(api_client.Api): + + def post_minimum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py new file mode 100644 index 00000000000..5ca6f649c60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minimum_validation_with_signed_integer_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger + +# body param +SchemaForRequestBodyApplicationJson = MinimumValidationWithSignedInteger + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinimumValidationWithSignedIntegerRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinimumValidationWithSignedIntegerRequestBody(api_client.Api): + + def post_minimum_validation_with_signed_integer_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minitems_validation_request_body.py new file mode 100644 index 00000000000..b7f9e9b45f3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minitems_validation import MinitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = MinitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinitemsValidationRequestBody(api_client.Api): + + def post_minitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minlength_validation_request_body.py new file mode 100644 index 00000000000..9fbc87a18a7 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minlength_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minlength_validation import MinlengthValidation + +# body param +SchemaForRequestBodyApplicationJson = MinlengthValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinlengthValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinlengthValidationRequestBody(api_client.Api): + + def post_minlength_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minproperties_validation_request_body.py new file mode 100644 index 00000000000..330e6561079 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_minproperties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.minproperties_validation import MinpropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = MinpropertiesValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postMinpropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostMinpropertiesValidationRequestBody(api_client.Api): + + def post_minproperties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..be5eeac206e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_allof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAllofToCheckValidationSemantics + + +request_body_nested_allof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAllofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAllofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_allof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_allof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..c5d6520fc58 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_anyof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedAnyofToCheckValidationSemantics + + +request_body_nested_anyof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedAnyofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedAnyofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_anyof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_anyof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_items_request_body.py new file mode 100644 index 00000000000..a6439bb5618 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_items import NestedItems + +# body param +SchemaForRequestBodyApplicationJson = NestedItems + + +request_body_nested_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedItemsRequestBody(api_client.Api): + + def post_nested_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py new file mode 100644 index 00000000000..e919dd40de6 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nested_oneof_to_check_validation_semantics_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics + +# body param +SchemaForRequestBodyApplicationJson = NestedOneofToCheckValidationSemantics + + +request_body_nested_oneof_to_check_validation_semantics = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNestedOneofToCheckValidationSemanticsRequestBody(api_client.Api): + + def post_nested_oneof_to_check_validation_semantics_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_nested_oneof_to_check_validation_semantics.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_more_complex_schema_request_body.py new file mode 100644 index 00000000000..cca040f3496 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_more_complex_schema_request_body.py @@ -0,0 +1,216 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + + + class NotSchema( + DictSchema + ): + foo = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + foo: typing.Union[foo, Unset] = unset, + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'NotSchema': + return super().__new__( + cls, + *args, + foo=foo, + _configuration=_configuration, + **kwargs, + ) + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotMoreComplexSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotMoreComplexSchemaRequestBody(api_client.Api): + + def post_not_more_complex_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_request_body.py new file mode 100644 index 00000000000..26a993683de --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_not_request_body.py @@ -0,0 +1,195 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + ComposedSchema +): + + @classmethod + @property + @functools.cache + def _composed_schemas(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 + NotSchema = IntSchema + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + 'not': + NotSchema + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Type[Schema], + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNotRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNotRequestBody(api_client.Api): + + def post_not_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nul_characters_in_strings_request_body.py new file mode 100644 index 00000000000..0cd4f2b03c5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_nul_characters_in_strings_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.nul_characters_in_strings import NulCharactersInStrings + +# body param +SchemaForRequestBodyApplicationJson = NulCharactersInStrings + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNulCharactersInStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNulCharactersInStringsRequestBody(api_client.Api): + + def post_nul_characters_in_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py new file mode 100644 index 00000000000..bbe9c2529ae --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_null_type_matches_only_the_null_object_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NoneSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNullTypeMatchesOnlyTheNullObjectRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNullTypeMatchesOnlyTheNullObjectRequestBody(api_client.Api): + + def post_null_type_matches_only_the_null_object_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_number_type_matches_numbers_request_body.py new file mode 100644 index 00000000000..8bdc5593dd8 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_number_type_matches_numbers_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = NumberSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postNumberTypeMatchesNumbersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostNumberTypeMatchesNumbersRequestBody(api_client.Api): + + def post_number_type_matches_numbers_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_properties_validation_request_body.py new file mode 100644 index 00000000000..bf67f4e981f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_properties_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.object_properties_validation import ObjectPropertiesValidation + +# body param +SchemaForRequestBodyApplicationJson = ObjectPropertiesValidation + + +request_body_object_properties_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectPropertiesValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectPropertiesValidationRequestBody(api_client.Api): + + def post_object_properties_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_object_properties_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_type_matches_objects_request_body.py new file mode 100644 index 00000000000..8ecca92de95 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_object_type_matches_objects_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = DictSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postObjectTypeMatchesObjectsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostObjectTypeMatchesObjectsRequestBody(api_client.Api): + + def post_object_type_matches_objects_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_complex_types_request_body.py new file mode 100644 index 00000000000..04cfec2d09d --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_complex_types_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_complex_types import OneofComplexTypes + +# body param +SchemaForRequestBodyApplicationJson = OneofComplexTypes + + +request_body_oneof_complex_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofComplexTypesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofComplexTypesRequestBody(api_client.Api): + + def post_oneof_complex_types_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_complex_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_request_body.py new file mode 100644 index 00000000000..5385a8c94d3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof import Oneof + +# body param +SchemaForRequestBodyApplicationJson = Oneof + + +request_body_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofRequestBody(api_client.Api): + + def post_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_base_schema_request_body.py new file mode 100644 index 00000000000..fb23d0bcfdd --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_base_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithBaseSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithBaseSchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithBaseSchemaRequestBody(api_client.Api): + + def post_oneof_with_base_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_empty_schema_request_body.py new file mode 100644 index 00000000000..95edbc98a65 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_oneof_with_empty_schema_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema + +# body param +SchemaForRequestBodyApplicationJson = OneofWithEmptySchema + + +request_body_oneof_with_empty_schema = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postOneofWithEmptySchemaRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostOneofWithEmptySchemaRequestBody(api_client.Api): + + def post_oneof_with_empty_schema_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_oneof_with_empty_schema.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_is_not_anchored_request_body.py new file mode 100644 index 00000000000..3a2a7b18b84 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_is_not_anchored_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored + +# body param +SchemaForRequestBodyApplicationJson = PatternIsNotAnchored + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternIsNotAnchoredRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternIsNotAnchoredRequestBody(api_client.Api): + + def post_pattern_is_not_anchored_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_validation_request_body.py new file mode 100644 index 00000000000..1e8900bac1a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_pattern_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.pattern_validation import PatternValidation + +# body param +SchemaForRequestBodyApplicationJson = PatternValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPatternValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPatternValidationRequestBody(api_client.Api): + + def post_pattern_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_properties_with_escaped_characters_request_body.py new file mode 100644 index 00000000000..02efabfe995 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_properties_with_escaped_characters_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters + +# body param +SchemaForRequestBodyApplicationJson = PropertiesWithEscapedCharacters + + +request_body_properties_with_escaped_characters = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertiesWithEscapedCharactersRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertiesWithEscapedCharactersRequestBody(api_client.Api): + + def post_properties_with_escaped_characters_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_properties_with_escaped_characters.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py new file mode 100644 index 00000000000..2a0f5a933d4 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_property_named_ref_that_is_not_a_reference_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference + +# body param +SchemaForRequestBodyApplicationJson = PropertyNamedRefThatIsNotAReference + + +request_body_property_named_ref_that_is_not_a_reference = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postPropertyNamedRefThatIsNotAReferenceRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostPropertyNamedRefThatIsNotAReferenceRequestBody(api_client.Api): + + def post_property_named_ref_that_is_not_a_reference_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_property_named_ref_that_is_not_a_reference.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_additionalproperties_request_body.py new file mode 100644 index 00000000000..95a5e59a87f --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_additionalproperties_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_additionalproperties import RefInAdditionalproperties + +# body param +SchemaForRequestBodyApplicationJson = RefInAdditionalproperties + + +request_body_ref_in_additionalproperties = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAdditionalpropertiesRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAdditionalpropertiesRequestBody(api_client.Api): + + def post_ref_in_additionalproperties_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_additionalproperties.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_allof_request_body.py new file mode 100644 index 00000000000..d574a98686e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_allof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_allof import RefInAllof + +# body param +SchemaForRequestBodyApplicationJson = RefInAllof + + +request_body_ref_in_allof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAllofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAllofRequestBody(api_client.Api): + + def post_ref_in_allof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_allof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_anyof_request_body.py new file mode 100644 index 00000000000..8a02d33492b --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_anyof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_anyof import RefInAnyof + +# body param +SchemaForRequestBodyApplicationJson = RefInAnyof + + +request_body_ref_in_anyof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInAnyofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInAnyofRequestBody(api_client.Api): + + def post_ref_in_anyof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_anyof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_items_request_body.py new file mode 100644 index 00000000000..8fe32a023d1 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_items_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_items import RefInItems + +# body param +SchemaForRequestBodyApplicationJson = RefInItems + + +request_body_ref_in_items = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInItemsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInItemsRequestBody(api_client.Api): + + def post_ref_in_items_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_items.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_oneof_request_body.py new file mode 100644 index 00000000000..73c2d4e9680 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_oneof_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_oneof import RefInOneof + +# body param +SchemaForRequestBodyApplicationJson = RefInOneof + + +request_body_ref_in_oneof = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInOneofRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInOneofRequestBody(api_client.Api): + + def post_ref_in_oneof_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_oneof.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_property_request_body.py new file mode 100644 index 00000000000..10a31753244 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_ref_in_property_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.ref_in_property import RefInProperty + +# body param +SchemaForRequestBodyApplicationJson = RefInProperty + + +request_body_ref_in_property = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRefInPropertyRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRefInPropertyRequestBody(api_client.Api): + + def post_ref_in_property_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_ref_in_property.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_default_validation_request_body.py new file mode 100644 index 00000000000..7059686bfa3 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_default_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_default_validation import RequiredDefaultValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredDefaultValidation + + +request_body_required_default_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredDefaultValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredDefaultValidationRequestBody(api_client.Api): + + def post_required_default_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_default_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_validation_request_body.py new file mode 100644 index 00000000000..1cd7d8cf296 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_validation import RequiredValidation + +# body param +SchemaForRequestBodyApplicationJson = RequiredValidation + + +request_body_required_validation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredValidationRequestBody(api_client.Api): + + def post_required_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_validation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_with_empty_array_request_body.py new file mode 100644 index 00000000000..6bf34d75b60 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_required_with_empty_array_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray + +# body param +SchemaForRequestBodyApplicationJson = RequiredWithEmptyArray + + +request_body_required_with_empty_array = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postRequiredWithEmptyArrayRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostRequiredWithEmptyArrayRequestBody(api_client.Api): + + def post_required_with_empty_array_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_required_with_empty_array.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_simple_enum_validation_request_body.py new file mode 100644 index 00000000000..af46c1f8580 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_simple_enum_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.simple_enum_validation import SimpleEnumValidation + +# body param +SchemaForRequestBodyApplicationJson = SimpleEnumValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postSimpleEnumValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostSimpleEnumValidationRequestBody(api_client.Api): + + def post_simple_enum_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_string_type_matches_strings_request_body.py new file mode 100644 index 00000000000..704d093b41a --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_string_type_matches_strings_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postStringTypeMatchesStringsRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostStringTypeMatchesStringsRequestBody(api_client.Api): + + def post_string_type_matches_strings_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py new file mode 100644 index 00000000000..3feabb524b5 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + +# body param +SchemaForRequestBodyApplicationJson = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing + + +request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody(api_client.Api): + + def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_the_default_keyword_does_not_do_anything_if_the_property_is_missing.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_false_validation_request_body.py new file mode 100644 index 00000000000..6f048e4f347 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_false_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_false_validation import UniqueitemsFalseValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsFalseValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsFalseValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsFalseValidationRequestBody(api_client.Api): + + def post_uniqueitems_false_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_validation_request_body.py new file mode 100644 index 00000000000..09d4d4c710e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uniqueitems_validation_request_body.py @@ -0,0 +1,157 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from unit_test_api.model.uniqueitems_validation import UniqueitemsValidation + +# body param +SchemaForRequestBodyApplicationJson = UniqueitemsValidation + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUniqueitemsValidationRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUniqueitemsValidationRequestBody(api_client.Api): + + def post_uniqueitems_validation_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_format_request_body.py new file mode 100644 index 00000000000..84f6c8e7adc --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriFormatRequestBody(api_client.Api): + + def post_uri_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_reference_format_request_body.py new file mode 100644 index 00000000000..8b2935bd02e --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_reference_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriReferenceFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriReferenceFormatRequestBody(api_client.Api): + + def post_uri_reference_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_template_format_request_body.py new file mode 100644 index 00000000000..352ea7ebdc9 --- /dev/null +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api/request_body_api_endpoints/post_uri_template_format_request_body.py @@ -0,0 +1,155 @@ +# 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 +from frozendict import frozendict # noqa: F401 + +from unit_test_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + UUIDSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + Configuration, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + Int32Base, + Int64Base, + Float32Base, + Float64Base, + NumberBase, + UUIDBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + NoneClass, + BoolClass, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/requestBody/postUriTemplateFormatRequestBody' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class PostUriTemplateFormatRequestBody(api_client.Api): + + def post_uri_template_format_request_body( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = _path + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py index e69de29bb2d..394c607b7ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +# flake8: noqa + +# Import all APIs into this package. +# If you have many APIs here with many many models used in each API this may +# raise a `RecursionError`. +# In order to avoid this, import only the API that you directly need like: +# +# from unit_test_api.api.json_api import JsonApi +# +# or import this package, but before doing it, use: +# +# import sys +# sys.setrecursionlimit(n) + +# Import APIs into API package: +from unit_test_api.api.json_api import JsonApi +from unit_test_api.api.post_api import PostApi +from unit_test_api.api.request_body_api import RequestBodyApi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py index 80407ef4b44..ee4ca7e8424 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py +++ b/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py @@ -90,7 +90,7 @@ class Configuration(object): ): """Constructor """ - self._base_path = "http://localhost" if host is None else host + self._base_path = "https://someserver.com/v1" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -384,7 +384,7 @@ class Configuration(object): """ return [ { - 'url': "", + 'url': "https://someserver.com/v1", 'description': "No description provided", } ] 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 d4f8e67b4e4..9b6e7f23593 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 @@ -379,15 +379,18 @@ class Singleton: _instances = {} def __new__(cls, arg: typing.Any, **kwargs): - key = (cls, arg) + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg, str(arg)) if key not in cls._instances: - if arg in {None, True, False}: - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, BoolClass): - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, NoneClass): + if isinstance(arg, (none_type, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: 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 20e903d4936..b4237d1d949 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -379,15 +379,18 @@ class Singleton: _instances = {} def __new__(cls, arg: typing.Any, **kwargs): - key = (cls, arg) + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg, str(arg)) if key not in cls._instances: - if arg in {None, True, False}: - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, BoolClass): - inst = super().__new__(cls) - cls._instances[key] = inst - elif isinstance(arg, NoneClass): + if isinstance(arg, (none_type, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py index e69de29bb2d..2d2e1b5c730 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/test/__init__.py @@ -0,0 +1,68 @@ +import json +import typing + +import urllib3 +from urllib3._collections import HTTPHeaderDict + + +class ApiTestMixin: + json_content_type = 'application/json' + user_agent = 'OpenAPI-Generator/1.0.0/python' + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = 'application/json', + accept_content_type: typing.Optional[str] = 'application/json', + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8')