From fd829c567859de95300fe47a3c65f0f58573a61f Mon Sep 17 00:00:00 2001 From: Robert Schweizer Date: Wed, 15 Mar 2023 08:31:36 +0100 Subject: [PATCH 1/4] fix: Prevent special characters in descriptions from breaking docstrings --- openapi_python_client/templates/endpoint_macros.py.jinja | 2 +- openapi_python_client/templates/model.py.jinja | 2 +- openapi_python_client/templates/package_init.py.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi_python_client/templates/endpoint_macros.py.jinja b/openapi_python_client/templates/endpoint_macros.py.jinja index 4dc0575f9..e897f3069 100644 --- a/openapi_python_client/templates/endpoint_macros.py.jinja +++ b/openapi_python_client/templates/endpoint_macros.py.jinja @@ -141,7 +141,7 @@ json_body=json_body, {% endmacro %} {% macro docstring(endpoint, return_string) %} -"""{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}} +r"""{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}} {% endif -%} {%- if endpoint.description %} {{ endpoint.description | wordwrap(100) }} diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 98f2d2682..5e38a296e 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -35,7 +35,7 @@ T = TypeVar("T", bound="{{ class_name }}") @attr.s(auto_attribs=True) class {{ class_name }}: - """{% if model.title %}{{ model.title | wordwrap(116) }} + r"""{% if model.title %}{{ model.title | wordwrap(116) }} {% endif -%} {%- if model.description %}{{ model.description | wordwrap(116) }} diff --git a/openapi_python_client/templates/package_init.py.jinja b/openapi_python_client/templates/package_init.py.jinja index 366a7e508..17df5ae05 100644 --- a/openapi_python_client/templates/package_init.py.jinja +++ b/openapi_python_client/templates/package_init.py.jinja @@ -1,4 +1,4 @@ -""" {{ package_description }} """ +r""" {{ package_description }} """ from .client import AuthenticatedClient, Client __all__ = ( From a1cf1f442ee64e320b2ec262334447855260ba80 Mon Sep 17 00:00:00 2001 From: Robert Schweizer Date: Wed, 15 Mar 2023 16:47:07 +0100 Subject: [PATCH 2/4] Update tests --- .../my_test_api_client/__init__.py | 2 +- .../api/default/get_common_parameters.py | 4 +- .../api/default/post_common_parameters.py | 4 +- .../api/location/get_location_header_types.py | 4 +- .../get_location_query_optionality.py | 4 +- .../get_parameter_references_path_param.py | 4 +- ...lete_common_parameters_overriding_param.py | 4 +- .../get_common_parameters_overriding_param.py | 4 +- .../get_same_name_multiple_locations_param.py | 4 +- .../parameters/multiple_path_parameters.py | 4 +- ..._responses_unions_simple_before_complex.py | 8 ++-- .../api/tag1/get_tag_with_number.py | 4 +- .../api/tests/callback_test.py | 8 ++-- .../api/tests/defaults_tests_defaults_post.py | 8 ++-- .../api/tests/get_basic_list_of_booleans.py | 8 ++-- .../api/tests/get_basic_list_of_floats.py | 8 ++-- .../api/tests/get_basic_list_of_integers.py | 8 ++-- .../api/tests/get_basic_list_of_strings.py | 8 ++-- .../api/tests/get_user_list.py | 8 ++-- .../api/tests/int_enum_tests_int_enum_post.py | 8 ++-- .../tests/json_body_tests_json_body_post.py | 8 ++-- .../no_response_tests_no_response_get.py | 4 +- .../octet_stream_tests_octet_stream_get.py | 8 ++-- .../api/tests/post_form_data.py | 4 +- .../api/tests/post_form_data_inline.py | 4 +- .../api/tests/post_tests_json_body_string.py | 8 ++-- .../api/tests/test_inline_objects.py | 8 ++-- ..._with_cookie_auth_token_with_cookie_get.py | 4 +- ...d_content_tests_unsupported_content_get.py | 4 +- .../tests/upload_file_tests_upload_post.py | 8 ++-- ...upload_multiple_files_tests_upload_post.py | 8 ++-- .../my_test_api_client/api/true_/false_.py | 4 +- .../my_test_api_client/models/__init__.py | 2 + .../my_test_api_client/models/a_form_data.py | 2 +- .../my_test_api_client/models/a_model.py | 2 +- ...roperties_reference_that_are_not_object.py | 2 +- .../all_of_has_properties_but_no_type.py | 2 +- .../models/all_of_sub_model.py | 2 +- ...h_a_circular_ref_in_items_object_a_item.py | 2 +- ...ems_object_additional_properties_a_item.py | 2 +- ...ems_object_additional_properties_b_item.py | 2 +- ...h_a_circular_ref_in_items_object_b_item.py | 2 +- ...items_object_additional_properties_item.py | 2 +- ...th_a_recursive_ref_in_items_object_item.py | 2 +- .../models/another_all_of_sub_model.py | 2 +- .../body_upload_file_tests_upload_post.py | 2 +- ...e_tests_upload_post_additional_property.py | 2 +- ..._tests_upload_post_some_nullable_object.py | 2 +- ...load_file_tests_upload_post_some_object.py | 2 +- ..._tests_upload_post_some_optional_object.py | 2 +- .../models/free_form_model.py | 2 +- .../models/http_validation_error.py | 2 +- .../my_test_api_client/models/import_.py | 2 +- .../models/model_from_all_of.py | 2 +- .../my_test_api_client/models/model_name.py | 2 +- .../models/model_reference_with_periods.py | 2 +- ...odel_with_additional_properties_inlined.py | 2 +- ..._properties_inlined_additional_property.py | 2 +- .../model_with_additional_properties_refed.py | 2 +- .../models/model_with_any_json_properties.py | 2 +- ...n_properties_additional_property_type_0.py | 2 +- .../model_with_backslash_in_description.py | 46 +++++++++++++++++++ .../models/model_with_circular_ref_a.py | 2 +- .../models/model_with_circular_ref_b.py | 2 +- ...circular_ref_in_additional_properties_a.py | 2 +- ...circular_ref_in_additional_properties_b.py | 2 +- .../models/model_with_date_time_property.py | 2 +- ...el_with_primitive_additional_properties.py | 2 +- ...ive_additional_properties_a_date_holder.py | 2 +- .../models/model_with_property_ref.py | 2 +- .../models/model_with_recursive_ref.py | 2 +- ..._recursive_ref_in_additional_properties.py | 2 +- .../models/model_with_union_property.py | 2 +- .../model_with_union_property_inlined.py | 2 +- ...ith_union_property_inlined_fruit_type_0.py | 2 +- ...ith_union_property_inlined_fruit_type_1.py | 2 +- .../my_test_api_client/models/none.py | 2 +- .../models/post_form_data_inline_data.py | 2 +- ...ions_simple_before_complex_response_200.py | 2 +- ...ple_before_complex_response_200a_type_1.py | 2 +- .../models/test_inline_objects_json_body.py | 2 +- .../test_inline_objects_response_200.py | 2 +- .../models/validation_error.py | 2 +- end_to_end_tests/openapi.json | 4 ++ .../integration_tests/__init__.py | 2 +- .../api/body/post_body_multipart.py | 8 ++-- .../api/parameters/post_parameters_header.py | 8 ++-- .../post_body_multipart_multipart_data.py | 2 +- .../post_body_multipart_response_200.py | 2 +- .../post_parameters_header_response_200.py | 2 +- .../integration_tests/models/problem.py | 2 +- .../integration_tests/models/public_error.py | 2 +- 92 files changed, 208 insertions(+), 156 deletions(-) create mode 100644 end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py diff --git a/end_to_end_tests/golden-record/my_test_api_client/__init__.py b/end_to_end_tests/golden-record/my_test_api_client/__init__.py index 530928e7a..430a31454 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/__init__.py +++ b/end_to_end_tests/golden-record/my_test_api_client/__init__.py @@ -1,4 +1,4 @@ -""" A client library for accessing My Test API """ +r""" A client library for accessing My Test API """ from .client import AuthenticatedClient, Client __all__ = ( diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py index eea2a39cb..01d3f52fd 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: common (Union[Unset, None, str]): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: common (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py index 54f11f8dc..94aa81333 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: common (Union[Unset, None, str]): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: common (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py index ab6ae3180..e9ee76b17 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py @@ -80,7 +80,7 @@ def sync_detailed( int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET, string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET, ) -> Response[Any]: - """ + r""" Args: boolean_header (Union[Unset, bool]): string_header (Union[Unset, str]): @@ -125,7 +125,7 @@ async def asyncio_detailed( int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET, string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET, ) -> Response[Any]: - """ + r""" Args: boolean_header (Union[Unset, bool]): string_header (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py index 427cf04dc..cfc5a094b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py @@ -83,7 +83,7 @@ def sync_detailed( null_not_required: Union[Unset, None, datetime.datetime] = UNSET, not_null_not_required: Union[Unset, None, datetime.datetime] = UNSET, ) -> Response[Any]: - """ + r""" Args: not_null_required (datetime.datetime): null_required (Union[Unset, None, datetime.datetime]): @@ -122,7 +122,7 @@ async def asyncio_detailed( null_not_required: Union[Unset, None, datetime.datetime] = UNSET, not_null_not_required: Union[Unset, None, datetime.datetime] = UNSET, ) -> Response[Any]: - """ + r""" Args: not_null_required (datetime.datetime): null_required (Union[Unset, None, datetime.datetime]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py index bdb518de5..269b38698 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py @@ -70,7 +70,7 @@ def sync_detailed( header_param: str, cookie_param: str, ) -> Response[Any]: - """Test different types of parameter references + r"""Test different types of parameter references Args: path_param (str): @@ -113,7 +113,7 @@ async def asyncio_detailed( header_param: str, cookie_param: str, ) -> Response[Any]: - """Test different types of parameter references + r"""Test different types of parameter references Args: path_param (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py index 6ddea0265..1ed852393 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py @@ -58,7 +58,7 @@ def sync_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: param_path (str): param_query (Union[Unset, None, str]): @@ -91,7 +91,7 @@ async def asyncio_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: param_path (str): param_query (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py index 2089e9c59..d3cc9e135 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py @@ -58,7 +58,7 @@ def sync_detailed( client: Client, param_query: str = "overridden_in_GET", ) -> Response[Any]: - """Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code + r"""Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code Args: param_path (str): @@ -93,7 +93,7 @@ async def asyncio_detailed( client: Client, param_query: str = "overridden_in_GET", ) -> Response[Any]: - """Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code + r"""Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code Args: param_path (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py index c6e0f4736..a3bf6ef13 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py @@ -68,7 +68,7 @@ def sync_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: param_path (str): param_query (Union[Unset, None, str]): @@ -107,7 +107,7 @@ async def asyncio_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: - """ + r""" Args: param_path (str): param_query (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py index a005a85ac..bbbe475ff 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py @@ -58,7 +58,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - """ + r""" Args: param4 (str): param2 (int): @@ -97,7 +97,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - """ + r""" Args: param4 (str): param2 (int): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py index 811633348..17f41bbc7 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py @@ -57,7 +57,7 @@ def sync_detailed( *, client: Client, ) -> Response[PostResponsesUnionsSimpleBeforeComplexResponse200]: - """Regression test for #603 + r"""Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -83,7 +83,7 @@ def sync( *, client: Client, ) -> Optional[PostResponsesUnionsSimpleBeforeComplexResponse200]: - """Regression test for #603 + r"""Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,7 +102,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[PostResponsesUnionsSimpleBeforeComplexResponse200]: - """Regression test for #603 + r"""Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,7 +126,7 @@ async def asyncio( *, client: Client, ) -> Optional[PostResponsesUnionsSimpleBeforeComplexResponse200]: - """Regression test for #603 + r"""Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py index 5df86a828..203420846 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - """ + r""" Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -73,7 +73,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - """ + r""" Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py index ca87484c4..55a8724eb 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - """Path with callback + r"""Path with callback Try sending a request related to a callback @@ -93,7 +93,7 @@ def sync( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Path with callback + r"""Path with callback Try sending a request related to a callback @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - """Path with callback + r"""Path with callback Try sending a request related to a callback @@ -150,7 +150,7 @@ async def asyncio( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Path with callback + r"""Path with callback Try sending a request related to a callback diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py index 44a2cc859..024c25771 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py @@ -137,7 +137,7 @@ def sync_detailed( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Response[Union[Any, HTTPValidationError]]: - """Defaults + r"""Defaults Args: string_prop (str): Default: 'the default string'. @@ -198,7 +198,7 @@ def sync( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Optional[Union[Any, HTTPValidationError]]: - """Defaults + r"""Defaults Args: string_prop (str): Default: 'the default string'. @@ -252,7 +252,7 @@ async def asyncio_detailed( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Response[Union[Any, HTTPValidationError]]: - """Defaults + r"""Defaults Args: string_prop (str): Default: 'the default string'. @@ -311,7 +311,7 @@ async def asyncio( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Optional[Union[Any, HTTPValidationError]]: - """Defaults + r"""Defaults Args: string_prop (str): Default: 'the default string'. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py index ce71633d9..842ef8b74 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[bool]]: - """Get Basic List Of Booleans + r"""Get Basic List Of Booleans Get a list of booleans @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[bool]]: - """Get Basic List Of Booleans + r"""Get Basic List Of Booleans Get a list of booleans @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[bool]]: - """Get Basic List Of Booleans + r"""Get Basic List Of Booleans Get a list of booleans @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[bool]]: - """Get Basic List Of Booleans + r"""Get Basic List Of Booleans Get a list of booleans diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py index dcb97ade5..0fcd30609 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[float]]: - """Get Basic List Of Floats + r"""Get Basic List Of Floats Get a list of floats @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[float]]: - """Get Basic List Of Floats + r"""Get Basic List Of Floats Get a list of floats @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[float]]: - """Get Basic List Of Floats + r"""Get Basic List Of Floats Get a list of floats @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[float]]: - """Get Basic List Of Floats + r"""Get Basic List Of Floats Get a list of floats diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py index 800c29608..ebb453096 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[int]]: - """Get Basic List Of Integers + r"""Get Basic List Of Integers Get a list of integers @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[int]]: - """Get Basic List Of Integers + r"""Get Basic List Of Integers Get a list of integers @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[int]]: - """Get Basic List Of Integers + r"""Get Basic List Of Integers Get a list of integers @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[int]]: - """Get Basic List Of Integers + r"""Get Basic List Of Integers Get a list of integers diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py index 2a84b2b5e..7f4106016 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[str]]: - """Get Basic List Of Strings + r"""Get Basic List Of Strings Get a list of strings @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[str]]: - """Get Basic List Of Strings + r"""Get Basic List Of Strings Get a list of strings @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[str]]: - """Get Basic List Of Strings + r"""Get Basic List Of Strings Get a list of strings @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[str]]: - """Get Basic List Of Strings + r"""Get Basic List Of Strings Get a list of strings diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py index 6cffd7741..15607c274 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py @@ -115,7 +115,7 @@ def sync_detailed( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Response[Union[HTTPValidationError, List["AModel"]]]: - """Get List + r"""Get List Get a list of things @@ -157,7 +157,7 @@ def sync( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List["AModel"]]]: - """Get List + r"""Get List Get a list of things @@ -192,7 +192,7 @@ async def asyncio_detailed( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Response[Union[HTTPValidationError, List["AModel"]]]: - """Get List + r"""Get List Get a list of things @@ -232,7 +232,7 @@ async def asyncio( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List["AModel"]]]: - """Get List + r"""Get List Get a list of things diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py index 4e23476f5..8566b4334 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py @@ -65,7 +65,7 @@ def sync_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: - """Int Enum + r"""Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -96,7 +96,7 @@ def sync( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - """Int Enum + r"""Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -120,7 +120,7 @@ async def asyncio_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: - """Int Enum + r"""Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -149,7 +149,7 @@ async def asyncio( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - """Int Enum + r"""Int Enum Args: int_enum (AnIntEnum): An enumeration. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py index 383522958..065c29bf6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - """Json Body + r"""Json Body Try sending a JSON body @@ -93,7 +93,7 @@ def sync( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Json Body + r"""Json Body Try sending a JSON body @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - """Json Body + r"""Json Body Try sending a JSON body @@ -150,7 +150,7 @@ async def asyncio( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Json Body + r"""Json Body Try sending a JSON body diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py index 933184d3f..6e442b12c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - """No Response + r"""No Response Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -74,7 +74,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - """No Response + r"""No Response Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py index 99859332e..94d567ebc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py @@ -51,7 +51,7 @@ def sync_detailed( *, client: Client, ) -> Response[File]: - """Octet Stream + r"""Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -77,7 +77,7 @@ def sync( *, client: Client, ) -> Optional[File]: - """Octet Stream + r"""Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +96,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[File]: - """Octet Stream + r"""Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -120,7 +120,7 @@ async def asyncio( *, client: Client, ) -> Optional[File]: - """Octet Stream + r"""Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py index ff9e887f4..8cedf3c28 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py @@ -52,7 +52,7 @@ def sync_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: - """Post form data + r"""Post form data Post form data @@ -82,7 +82,7 @@ async def asyncio_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: - """Post form data + r"""Post form data Post form data diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py index 46536a27a..c1e86669e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py @@ -52,7 +52,7 @@ def sync_detailed( client: Client, form_data: PostFormDataInlineData, ) -> Response[Any]: - """Post form data (inline schema) + r"""Post form data (inline schema) Post form data (inline schema) @@ -82,7 +82,7 @@ async def asyncio_detailed( client: Client, form_data: PostFormDataInlineData, ) -> Response[Any]: - """Post form data (inline schema) + r"""Post form data (inline schema) Post form data (inline schema) diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py index 6a1d178dc..3747deec0 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py @@ -59,7 +59,7 @@ def sync_detailed( client: Client, json_body: str, ) -> Response[Union[HTTPValidationError, str]]: - """Json Body Which is String + r"""Json Body Which is String Args: json_body (str): @@ -90,7 +90,7 @@ def sync( client: Client, json_body: str, ) -> Optional[Union[HTTPValidationError, str]]: - """Json Body Which is String + r"""Json Body Which is String Args: json_body (str): @@ -114,7 +114,7 @@ async def asyncio_detailed( client: Client, json_body: str, ) -> Response[Union[HTTPValidationError, str]]: - """Json Body Which is String + r"""Json Body Which is String Args: json_body (str): @@ -143,7 +143,7 @@ async def asyncio( client: Client, json_body: str, ) -> Optional[Union[HTTPValidationError, str]]: - """Json Body Which is String + r"""Json Body Which is String Args: json_body (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py index d1533c0e1..2f67cd6d4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py @@ -57,7 +57,7 @@ def sync_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: - """Test Inline Objects + r"""Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -88,7 +88,7 @@ def sync( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - """Test Inline Objects + r"""Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -112,7 +112,7 @@ async def asyncio_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: - """Test Inline Objects + r"""Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -141,7 +141,7 @@ async def asyncio( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - """Test Inline Objects + r"""Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py index 85d53d9da..ce77d920d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py @@ -54,7 +54,7 @@ def sync_detailed( client: Client, my_token: str, ) -> Response[Any]: - """TOKEN_WITH_COOKIE + r"""TOKEN_WITH_COOKIE Test optional cookie parameters @@ -87,7 +87,7 @@ async def asyncio_detailed( client: Client, my_token: str, ) -> Response[Any]: - """TOKEN_WITH_COOKIE + r"""TOKEN_WITH_COOKIE Test optional cookie parameters diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py index 2daec1319..0bdd93c34 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - """Unsupported Content + r"""Unsupported Content Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -74,7 +74,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - """Unsupported Content + r"""Unsupported Content Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py index d00ec5e40..421e72c1d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Response[Union[Any, HTTPValidationError]]: - """Upload File + r"""Upload File Upload a file @@ -93,7 +93,7 @@ def sync( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload File + r"""Upload File Upload a file @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Response[Union[Any, HTTPValidationError]]: - """Upload File + r"""Upload File Upload a file @@ -150,7 +150,7 @@ async def asyncio( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload File + r"""Upload File Upload a file diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py index 34add0e4e..898833e3c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py @@ -63,7 +63,7 @@ def sync_detailed( client: Client, multipart_data: List[File], ) -> Response[Union[Any, HTTPValidationError]]: - """Upload multiple files + r"""Upload multiple files Upload several files in the same request @@ -96,7 +96,7 @@ def sync( client: Client, multipart_data: List[File], ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload multiple files + r"""Upload multiple files Upload several files in the same request @@ -122,7 +122,7 @@ async def asyncio_detailed( client: Client, multipart_data: List[File], ) -> Response[Union[Any, HTTPValidationError]]: - """Upload multiple files + r"""Upload multiple files Upload several files in the same request @@ -153,7 +153,7 @@ async def asyncio( client: Client, multipart_data: List[File], ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload multiple files + r"""Upload multiple files Upload several files in the same request diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py index f8332a87a..c0b560f71 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, import_: str, ) -> Response[Any]: - """ + r""" Args: import_ (str): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, import_: str, ) -> Response[Any]: - """ + r""" Args: import_ (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py b/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py index c77cf0bc5..f63501d10 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/__init__.py @@ -47,6 +47,7 @@ from .model_with_additional_properties_refed import ModelWithAdditionalPropertiesRefed from .model_with_any_json_properties import ModelWithAnyJsonProperties from .model_with_any_json_properties_additional_property_type_0 import ModelWithAnyJsonPropertiesAdditionalPropertyType0 +from .model_with_backslash_in_description import ModelWithBackslashInDescription from .model_with_circular_ref_a import ModelWithCircularRefA from .model_with_circular_ref_b import ModelWithCircularRefB from .model_with_circular_ref_in_additional_properties_a import ModelWithCircularRefInAdditionalPropertiesA @@ -111,6 +112,7 @@ "ModelWithAdditionalPropertiesRefed", "ModelWithAnyJsonProperties", "ModelWithAnyJsonPropertiesAdditionalPropertyType0", + "ModelWithBackslashInDescription", "ModelWithCircularRefA", "ModelWithCircularRefB", "ModelWithCircularRefInAdditionalPropertiesA", diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py index 958b24ab5..827c287cf 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class AFormData: - """ + r""" Attributes: an_required_field (str): an_optional_field (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py index 9c1740dc8..62dd1fee3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py @@ -19,7 +19,7 @@ @attr.s(auto_attribs=True) class AModel: - """A Model for testing all the ways custom objects can be used + r"""A Model for testing all the ways custom objects can be used Attributes: an_enum_value (AnEnum): For testing Enums in all the ways they can be used diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py index 1f1c05565..6a50fdf10 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AModelWithPropertiesReferenceThatAreNotObject: - """ + r""" Attributes: enum_properties_ref (List[AnEnum]): str_properties_ref (List[str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py index 90918d021..7554b9538 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class AllOfHasPropertiesButNoType: - """ + r""" Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py index 5a46393fd..fadc09c5e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class AllOfSubModel: - """ + r""" Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py index 16fcbb88d..59b31ee23 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAItem: - """ + r""" Attributes: circular (Union[Unset, List['AnArrayWithACircularRefInItemsObjectBItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py index f03a87604..0fe749f89 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem: - """ """ + r""" """ additional_properties: Dict[str, List["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py index cdff09b4b..a880805fc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem: - """ """ + r""" """ additional_properties: Dict[str, List["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py index b15bb0f7b..105566e48 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectBItem: - """ + r""" Attributes: circular (Union[Unset, List['AnArrayWithACircularRefInItemsObjectAItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py index 52341b8bc..50e843205 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem: - """ """ + r""" """ additional_properties: Dict[str, List["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py index c14ee07c2..fc04b3cd3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class AnArrayWithARecursiveRefInItemsObjectItem: - """ + r""" Attributes: recursive (Union[Unset, List['AnArrayWithARecursiveRefInItemsObjectItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py index c339eebd3..4cb522aa8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class AnotherAllOfSubModel: - """ + r""" Attributes: another_sub_property (Union[Unset, str]): type (Union[Unset, AnotherAllOfSubModelType]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py index d858be5b6..c1b0dd92d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py @@ -27,7 +27,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPost: - """ + r""" Attributes: some_file (File): some_object (BodyUploadFileTestsUploadPostSomeObject): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py index 522355858..65ce0a622 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostAdditionalProperty: - """ + r""" Attributes: foo (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py index e809b413e..36d71ea54 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeNullableObject: - """ + r""" Attributes: bar (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py index 8a4f123de..3739537e1 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeObject: - """ + r""" Attributes: num (float): text (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py index a32d5f979..55fc40e11 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeOptionalObject: - """ + r""" Attributes: foo (str): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py index f8cc2151c..f4d287280 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class FreeFormModel: - """ """ + r""" """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py b/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py index 4d8e71670..62f81f2e0 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class HTTPValidationError: - """ + r""" Attributes: detail (Union[Unset, List['ValidationError']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/import_.py b/end_to_end_tests/golden-record/my_test_api_client/models/import_.py index 276a4f21b..040f55f89 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/import_.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/import_.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class Import: - """ """ + r""" """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py index 3dfc48a36..21112254e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelFromAllOf: - """ + r""" Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, AnotherAllOfSubModelType]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py index c87d4c208..6fa843d49 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelName: - """ """ + r""" """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py index 15bab8de5..6f5070cab 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelReferenceWithPeriods: - """A Model with periods in its reference""" + r"""A Model with periods in its reference""" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py index fb8ad21a8..ce8415a12 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py @@ -15,7 +15,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlined: - """ + r""" Attributes: a_number (Union[Unset, float]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py index 66b487c00..06886b3a0 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlinedAdditionalProperty: - """ + r""" Attributes: extra_props_prop (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py index d51c5d72c..59dcdb0cd 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesRefed: - """ """ + r""" """ additional_properties: Dict[str, AnEnum] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py index d28dbb30e..d4a613e2e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonProperties: - """ """ + r""" """ additional_properties: Dict[ str, Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", List[str], bool, float, int, str] diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py index 19e863fc4..4ae2bdba4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonPropertiesAdditionalPropertyType0: - """ """ + r""" """ additional_properties: Dict[str, str] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py new file mode 100644 index 000000000..834746187 --- /dev/null +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, List, Type, TypeVar + +import attr + +T = TypeVar("T", bound="ModelWithBackslashInDescription") + + +@attr.s(auto_attribs=True) +class ModelWithBackslashInDescription: + r"""Description with special character: \ + + """ + + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + model_with_backslash_in_description = cls() + + model_with_backslash_in_description.additional_properties = d + return model_with_backslash_in_description + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py index 11e31983d..0bc21f7f0 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefA: - """ + r""" Attributes: circular (Union[Unset, ModelWithCircularRefB]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py index 5fb34f4f4..69f0b8fb4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefB: - """ + r""" Attributes: circular (Union[Unset, ModelWithCircularRefA]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py index 0d9e0155c..d5fbbdf6b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefInAdditionalPropertiesA: - """ """ + r""" """ additional_properties: Dict[str, "ModelWithCircularRefInAdditionalPropertiesB"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py index 0583b40f8..fae5af988 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefInAdditionalPropertiesB: - """ """ + r""" """ additional_properties: Dict[str, "ModelWithCircularRefInAdditionalPropertiesA"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py index 1dfc6d406..d0f5d9e2c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithDateTimeProperty: - """ + r""" Attributes: datetime_ (Union[Unset, datetime.datetime]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py index 89144cfec..856147949 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py @@ -15,7 +15,7 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalProperties: - """ + r""" Attributes: a_date_holder (Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py index aa8a25252..8f658f3a9 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalPropertiesADateHolder: - """ """ + r""" """ additional_properties: Dict[str, datetime.datetime] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py index d1b8b2b11..0e43ce411 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithPropertyRef: - """ + r""" Attributes: inner (Union[Unset, ModelName]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py index b60e5a100..ddba0f0fe 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithRecursiveRef: - """ + r""" Attributes: recursive (Union[Unset, ModelWithRecursiveRef]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py index 64d327ee6..58ec1b07d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelWithRecursiveRefInAdditionalProperties: - """ """ + r""" """ additional_properties: Dict[str, "ModelWithRecursiveRefInAdditionalProperties"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py index e1fd0cf5b..bbe197ed8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionProperty: - """ + r""" Attributes: a_property (Union[AnEnum, AnIntEnum, Unset]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py index 0c6cb6d3a..828cfb5a8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py @@ -14,7 +14,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlined: - """ + r""" Attributes: fruit (Union['ModelWithUnionPropertyInlinedFruitType0', 'ModelWithUnionPropertyInlinedFruitType1', Unset]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py index 466bfe252..9fa44db89 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType0: - """ + r""" Attributes: apples (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py index a0dae4331..f4826b3d7 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType1: - """ + r""" Attributes: bananas (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/none.py b/end_to_end_tests/golden-record/my_test_api_client/models/none.py index e1722f094..a8cde36e6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/none.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/none.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class None_: - """ """ + r""" """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py index baac858b3..0642bd41c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class PostFormDataInlineData: - """ + r""" Attributes: a_required_field (str): an_optional_field (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py index 579c4dbd6..8c6896ac6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class PostResponsesUnionsSimpleBeforeComplexResponse200: - """ + r""" Attributes: a (Union['PostResponsesUnionsSimpleBeforeComplexResponse200AType1', str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py index 6b9ae2484..aae28a71f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostResponsesUnionsSimpleBeforeComplexResponse200AType1: - """ """ + r""" """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py index 66f8ce42c..07ba6cdce 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class TestInlineObjectsJsonBody: - """ + r""" Attributes: a_property (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py index 3f9c1c944..72a27e05d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class TestInlineObjectsResponse200: - """ + r""" Attributes: a_property (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py b/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py index e2f6539ee..347af8cf3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ValidationError: - """ + r""" Attributes: loc (List[str]): msg (str): diff --git a/end_to_end_tests/openapi.json b/end_to_end_tests/openapi.json index 803bedfeb..ef9fff702 100644 --- a/end_to_end_tests/openapi.json +++ b/end_to_end_tests/openapi.json @@ -2223,6 +2223,10 @@ "$ref": "#/components/schemas/AnArrayWithACircularRefInItemsObjectAdditionalPropertiesA" } } + }, + "ModelWithBackslashInDescription": { + "type": "object", + "description": "Description with special character: \\" } }, "parameters": { diff --git a/integration-tests/integration_tests/__init__.py b/integration-tests/integration_tests/__init__.py index 48f0fb8da..bbf16a83b 100644 --- a/integration-tests/integration_tests/__init__.py +++ b/integration-tests/integration_tests/__init__.py @@ -1,4 +1,4 @@ -""" A client library for accessing OpenAPI Test Server """ +r""" A client library for accessing OpenAPI Test Server """ from .client import AuthenticatedClient, Client __all__ = ( diff --git a/integration-tests/integration_tests/api/body/post_body_multipart.py b/integration-tests/integration_tests/api/body/post_body_multipart.py index 303443af7..dcdd4a8cd 100644 --- a/integration-tests/integration_tests/api/body/post_body_multipart.py +++ b/integration-tests/integration_tests/api/body/post_body_multipart.py @@ -66,7 +66,7 @@ def sync_detailed( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Response[Union[PostBodyMultipartResponse200, PublicError]]: - """ + r""" Args: multipart_data (PostBodyMultipartMultipartData): @@ -96,7 +96,7 @@ def sync( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Optional[Union[PostBodyMultipartResponse200, PublicError]]: - """ + r""" Args: multipart_data (PostBodyMultipartMultipartData): @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Response[Union[PostBodyMultipartResponse200, PublicError]]: - """ + r""" Args: multipart_data (PostBodyMultipartMultipartData): @@ -147,7 +147,7 @@ async def asyncio( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Optional[Union[PostBodyMultipartResponse200, PublicError]]: - """ + r""" Args: multipart_data (PostBodyMultipartMultipartData): diff --git a/integration-tests/integration_tests/api/parameters/post_parameters_header.py b/integration-tests/integration_tests/api/parameters/post_parameters_header.py index c89c4c304..012da5849 100644 --- a/integration-tests/integration_tests/api/parameters/post_parameters_header.py +++ b/integration-tests/integration_tests/api/parameters/post_parameters_header.py @@ -76,7 +76,7 @@ def sync_detailed( number_header: float, integer_header: int, ) -> Response[Union[PostParametersHeaderResponse200, PublicError]]: - """ + r""" Args: boolean_header (bool): string_header (str): @@ -115,7 +115,7 @@ def sync( number_header: float, integer_header: int, ) -> Optional[Union[PostParametersHeaderResponse200, PublicError]]: - """ + r""" Args: boolean_header (bool): string_header (str): @@ -147,7 +147,7 @@ async def asyncio_detailed( number_header: float, integer_header: int, ) -> Response[Union[PostParametersHeaderResponse200, PublicError]]: - """ + r""" Args: boolean_header (bool): string_header (str): @@ -184,7 +184,7 @@ async def asyncio( number_header: float, integer_header: int, ) -> Optional[Union[PostParametersHeaderResponse200, PublicError]]: - """ + r""" Args: boolean_header (bool): string_header (str): diff --git a/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py b/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py index 1c7f6f651..d63711c27 100644 --- a/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py +++ b/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class PostBodyMultipartMultipartData: - """ + r""" Attributes: a_string (str): file (File): For the sake of this test, include a file name and content type. The payload should also be valid diff --git a/integration-tests/integration_tests/models/post_body_multipart_response_200.py b/integration-tests/integration_tests/models/post_body_multipart_response_200.py index 319c25fd0..1e5b1a2e8 100644 --- a/integration-tests/integration_tests/models/post_body_multipart_response_200.py +++ b/integration-tests/integration_tests/models/post_body_multipart_response_200.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostBodyMultipartResponse200: - """ + r""" Attributes: a_string (str): Echo of the 'a_string' input parameter from the form. file_data (str): Echo of content of the 'file' input parameter from the form. diff --git a/integration-tests/integration_tests/models/post_parameters_header_response_200.py b/integration-tests/integration_tests/models/post_parameters_header_response_200.py index 772ffad3e..8723c9a97 100644 --- a/integration-tests/integration_tests/models/post_parameters_header_response_200.py +++ b/integration-tests/integration_tests/models/post_parameters_header_response_200.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostParametersHeaderResponse200: - """ + r""" Attributes: boolean (bool): Echo of the 'Boolean-Header' input parameter from the header. string (str): Echo of the 'String-Header' input parameter from the header. diff --git a/integration-tests/integration_tests/models/problem.py b/integration-tests/integration_tests/models/problem.py index d343123ab..8dda0495a 100644 --- a/integration-tests/integration_tests/models/problem.py +++ b/integration-tests/integration_tests/models/problem.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class Problem: - """ + r""" Attributes: parameter_name (Union[Unset, str]): description (Union[Unset, str]): diff --git a/integration-tests/integration_tests/models/public_error.py b/integration-tests/integration_tests/models/public_error.py index d5281d8ff..e6c3ede63 100644 --- a/integration-tests/integration_tests/models/public_error.py +++ b/integration-tests/integration_tests/models/public_error.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class PublicError: - """ + r""" Attributes: errors (Union[Unset, List[str]]): extra_parameters (Union[Unset, List[str]]): From 1512ec2307fb10e1a4427ea84e4436a89e70ac1f Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Sat, 18 Mar 2023 16:26:54 -0600 Subject: [PATCH 3/4] fix: Only make docstrings raw if they contain a backslash --- .../my_test_api_client/api/tests/__init__.py | 8 ++ .../my_test_api_client/__init__.py | 3 +- .../api/default/get_common_parameters.py | 4 +- .../api/default/post_common_parameters.py | 4 +- .../api/location/get_location_header_types.py | 4 +- .../get_location_query_optionality.py | 4 +- .../get_parameter_references_path_param.py | 4 +- ...lete_common_parameters_overriding_param.py | 4 +- .../get_common_parameters_overriding_param.py | 4 +- .../get_same_name_multiple_locations_param.py | 4 +- .../parameters/multiple_path_parameters.py | 4 +- ..._responses_unions_simple_before_complex.py | 8 +- .../api/tag1/get_tag_with_number.py | 4 +- .../api/tests/callback_test.py | 8 +- .../api/tests/defaults_tests_defaults_post.py | 8 +- .../api/tests/description_with_backslash.py | 98 +++++++++++++++++++ .../api/tests/get_basic_list_of_booleans.py | 8 +- .../api/tests/get_basic_list_of_floats.py | 8 +- .../api/tests/get_basic_list_of_integers.py | 8 +- .../api/tests/get_basic_list_of_strings.py | 8 +- .../api/tests/get_user_list.py | 8 +- .../api/tests/int_enum_tests_int_enum_post.py | 8 +- .../tests/json_body_tests_json_body_post.py | 8 +- .../no_response_tests_no_response_get.py | 4 +- .../octet_stream_tests_octet_stream_get.py | 8 +- .../api/tests/post_form_data.py | 4 +- .../api/tests/post_form_data_inline.py | 4 +- .../api/tests/post_tests_json_body_string.py | 8 +- .../api/tests/test_inline_objects.py | 8 +- ..._with_cookie_auth_token_with_cookie_get.py | 4 +- ...d_content_tests_unsupported_content_get.py | 4 +- .../tests/upload_file_tests_upload_post.py | 8 +- ...upload_multiple_files_tests_upload_post.py | 8 +- .../my_test_api_client/api/true_/false_.py | 4 +- .../my_test_api_client/models/a_form_data.py | 2 +- .../my_test_api_client/models/a_model.py | 2 +- ...roperties_reference_that_are_not_object.py | 2 +- .../all_of_has_properties_but_no_type.py | 2 +- .../models/all_of_sub_model.py | 2 +- ...h_a_circular_ref_in_items_object_a_item.py | 2 +- ...ems_object_additional_properties_a_item.py | 2 +- ...ems_object_additional_properties_b_item.py | 2 +- ...h_a_circular_ref_in_items_object_b_item.py | 2 +- ...items_object_additional_properties_item.py | 2 +- ...th_a_recursive_ref_in_items_object_item.py | 2 +- .../models/another_all_of_sub_model.py | 2 +- .../body_upload_file_tests_upload_post.py | 2 +- ...e_tests_upload_post_additional_property.py | 2 +- ..._tests_upload_post_some_nullable_object.py | 2 +- ...load_file_tests_upload_post_some_object.py | 2 +- ..._tests_upload_post_some_optional_object.py | 2 +- .../models/free_form_model.py | 2 +- .../models/http_validation_error.py | 2 +- .../my_test_api_client/models/import_.py | 2 +- .../models/model_from_all_of.py | 2 +- .../my_test_api_client/models/model_name.py | 2 +- .../models/model_reference_with_periods.py | 2 +- ...odel_with_additional_properties_inlined.py | 2 +- ..._properties_inlined_additional_property.py | 2 +- .../model_with_additional_properties_refed.py | 2 +- .../models/model_with_any_json_properties.py | 2 +- ...n_properties_additional_property_type_0.py | 2 +- .../model_with_backslash_in_description.py | 4 +- .../models/model_with_circular_ref_a.py | 2 +- .../models/model_with_circular_ref_b.py | 2 +- ...circular_ref_in_additional_properties_a.py | 2 +- ...circular_ref_in_additional_properties_b.py | 2 +- .../models/model_with_date_time_property.py | 2 +- ...el_with_primitive_additional_properties.py | 2 +- ...ive_additional_properties_a_date_holder.py | 2 +- .../models/model_with_property_ref.py | 2 +- .../models/model_with_recursive_ref.py | 2 +- ..._recursive_ref_in_additional_properties.py | 2 +- .../models/model_with_union_property.py | 2 +- .../model_with_union_property_inlined.py | 2 +- ...ith_union_property_inlined_fruit_type_0.py | 2 +- ...ith_union_property_inlined_fruit_type_1.py | 2 +- .../my_test_api_client/models/none.py | 2 +- .../models/post_form_data_inline_data.py | 2 +- ...ions_simple_before_complex_response_200.py | 2 +- ...ple_before_complex_response_200a_type_1.py | 2 +- .../models/test_inline_objects_json_body.py | 2 +- .../test_inline_objects_response_200.py | 2 +- .../models/validation_error.py | 2 +- end_to_end_tests/openapi.json | 15 +++ .../integration_tests/__init__.py | 3 +- .../api/body/post_body_multipart.py | 8 +- .../api/parameters/post_parameters_header.py | 8 +- .../post_body_multipart_multipart_data.py | 2 +- .../post_body_multipart_response_200.py | 2 +- .../post_parameters_header_response_200.py | 2 +- .../integration_tests/models/problem.py | 2 +- .../integration_tests/models/public_error.py | 2 +- .../templates/endpoint_macros.py.jinja | 10 +- openapi_python_client/templates/helpers.jinja | 8 ++ .../templates/model.py.jinja | 13 ++- .../templates/package_init.py.jinja | 4 +- 97 files changed, 308 insertions(+), 166 deletions(-) create mode 100644 end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py create mode 100644 openapi_python_client/templates/helpers.jinja diff --git a/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py b/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py index 13120943a..537c5c580 100644 --- a/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py +++ b/end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py @@ -5,6 +5,7 @@ from . import ( callback_test, defaults_tests_defaults_post, + description_with_backslash, get_basic_list_of_booleans, get_basic_list_of_floats, get_basic_list_of_integers, @@ -158,3 +159,10 @@ def callback_test(cls) -> types.ModuleType: Try sending a request related to a callback """ return callback_test + + @classmethod + def description_with_backslash(cls) -> types.ModuleType: + """ + Test description with \ + """ + return description_with_backslash diff --git a/end_to_end_tests/golden-record/my_test_api_client/__init__.py b/end_to_end_tests/golden-record/my_test_api_client/__init__.py index 430a31454..701fe7dcb 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/__init__.py +++ b/end_to_end_tests/golden-record/my_test_api_client/__init__.py @@ -1,4 +1,5 @@ -r""" A client library for accessing My Test API """ +""" A client library for accessing My Test API """ + from .client import AuthenticatedClient, Client __all__ = ( diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py index 01d3f52fd..eea2a39cb 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: common (Union[Unset, None, str]): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: common (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py index 94aa81333..54f11f8dc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: common (Union[Unset, None, str]): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: common (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py index e9ee76b17..ab6ae3180 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py @@ -80,7 +80,7 @@ def sync_detailed( int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET, string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET, ) -> Response[Any]: - r""" + """ Args: boolean_header (Union[Unset, bool]): string_header (Union[Unset, str]): @@ -125,7 +125,7 @@ async def asyncio_detailed( int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET, string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET, ) -> Response[Any]: - r""" + """ Args: boolean_header (Union[Unset, bool]): string_header (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py index cfc5a094b..427cf04dc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py @@ -83,7 +83,7 @@ def sync_detailed( null_not_required: Union[Unset, None, datetime.datetime] = UNSET, not_null_not_required: Union[Unset, None, datetime.datetime] = UNSET, ) -> Response[Any]: - r""" + """ Args: not_null_required (datetime.datetime): null_required (Union[Unset, None, datetime.datetime]): @@ -122,7 +122,7 @@ async def asyncio_detailed( null_not_required: Union[Unset, None, datetime.datetime] = UNSET, not_null_not_required: Union[Unset, None, datetime.datetime] = UNSET, ) -> Response[Any]: - r""" + """ Args: not_null_required (datetime.datetime): null_required (Union[Unset, None, datetime.datetime]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py index 269b38698..bdb518de5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py @@ -70,7 +70,7 @@ def sync_detailed( header_param: str, cookie_param: str, ) -> Response[Any]: - r"""Test different types of parameter references + """Test different types of parameter references Args: path_param (str): @@ -113,7 +113,7 @@ async def asyncio_detailed( header_param: str, cookie_param: str, ) -> Response[Any]: - r"""Test different types of parameter references + """Test different types of parameter references Args: path_param (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py index 1ed852393..6ddea0265 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py @@ -58,7 +58,7 @@ def sync_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: param_path (str): param_query (Union[Unset, None, str]): @@ -91,7 +91,7 @@ async def asyncio_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: param_path (str): param_query (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py index d3cc9e135..2089e9c59 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py @@ -58,7 +58,7 @@ def sync_detailed( client: Client, param_query: str = "overridden_in_GET", ) -> Response[Any]: - r"""Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code + """Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code Args: param_path (str): @@ -93,7 +93,7 @@ async def asyncio_detailed( client: Client, param_query: str = "overridden_in_GET", ) -> Response[Any]: - r"""Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code + """Test that if you have an overriding property from `PathItem` in `Operation`, it produces valid code Args: param_path (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py index a3bf6ef13..c6e0f4736 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py @@ -68,7 +68,7 @@ def sync_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: param_path (str): param_query (Union[Unset, None, str]): @@ -107,7 +107,7 @@ async def asyncio_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: - r""" + """ Args: param_path (str): param_query (Union[Unset, None, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py index bbbe475ff..a005a85ac 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py @@ -58,7 +58,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - r""" + """ Args: param4 (str): param2 (int): @@ -97,7 +97,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - r""" + """ Args: param4 (str): param2 (int): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py index 17f41bbc7..811633348 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py @@ -57,7 +57,7 @@ def sync_detailed( *, client: Client, ) -> Response[PostResponsesUnionsSimpleBeforeComplexResponse200]: - r"""Regression test for #603 + """Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -83,7 +83,7 @@ def sync( *, client: Client, ) -> Optional[PostResponsesUnionsSimpleBeforeComplexResponse200]: - r"""Regression test for #603 + """Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,7 +102,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[PostResponsesUnionsSimpleBeforeComplexResponse200]: - r"""Regression test for #603 + """Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,7 +126,7 @@ async def asyncio( *, client: Client, ) -> Optional[PostResponsesUnionsSimpleBeforeComplexResponse200]: - r"""Regression test for #603 + """Regression test for #603 Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py index 203420846..5df86a828 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - r""" + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. @@ -73,7 +73,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - r""" + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py index 55a8724eb..ca87484c4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/callback_test.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Path with callback + """Path with callback Try sending a request related to a callback @@ -93,7 +93,7 @@ def sync( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Path with callback + """Path with callback Try sending a request related to a callback @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Path with callback + """Path with callback Try sending a request related to a callback @@ -150,7 +150,7 @@ async def asyncio( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Path with callback + """Path with callback Try sending a request related to a callback diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py index 024c25771..44a2cc859 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py @@ -137,7 +137,7 @@ def sync_detailed( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Response[Union[Any, HTTPValidationError]]: - r"""Defaults + """Defaults Args: string_prop (str): Default: 'the default string'. @@ -198,7 +198,7 @@ def sync( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Defaults + """Defaults Args: string_prop (str): Default: 'the default string'. @@ -252,7 +252,7 @@ async def asyncio_detailed( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Response[Union[Any, HTTPValidationError]]: - r"""Defaults + """Defaults Args: string_prop (str): Default: 'the default string'. @@ -311,7 +311,7 @@ async def asyncio( model_prop: "ModelWithUnionProperty", required_model_prop: "ModelWithUnionProperty", ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Defaults + """Defaults Args: string_prop (str): Default: 'the default string'. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py new file mode 100644 index 000000000..db605c979 --- /dev/null +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/description_with_backslash.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...types import Response + + +def _get_kwargs( + *, + client: Client, +) -> Dict[str, Any]: + url = "{}/tests/description-with-backslash".format(client.base_url) + + headers: Dict[str, str] = client.get_headers() + cookies: Dict[str, Any] = client.get_cookies() + + return { + "method": "get", + "url": url, + "headers": headers, + "cookies": cookies, + "timeout": client.get_timeout(), + } + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}") + else: + return None + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Client, +) -> Response[Any]: + r""" Test description with \ + + Test description with \ + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + client=client, + ) + + response = httpx.request( + verify=client.verify_ssl, + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: Client, +) -> Response[Any]: + r""" Test description with \ + + Test description with \ + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + client=client, + ) + + async with httpx.AsyncClient(verify=client.verify_ssl) as _client: + response = await _client.request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py index 842ef8b74..ce71633d9 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[bool]]: - r"""Get Basic List Of Booleans + """Get Basic List Of Booleans Get a list of booleans @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[bool]]: - r"""Get Basic List Of Booleans + """Get Basic List Of Booleans Get a list of booleans @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[bool]]: - r"""Get Basic List Of Booleans + """Get Basic List Of Booleans Get a list of booleans @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[bool]]: - r"""Get Basic List Of Booleans + """Get Basic List Of Booleans Get a list of booleans diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py index 0fcd30609..dcb97ade5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[float]]: - r"""Get Basic List Of Floats + """Get Basic List Of Floats Get a list of floats @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[float]]: - r"""Get Basic List Of Floats + """Get Basic List Of Floats Get a list of floats @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[float]]: - r"""Get Basic List Of Floats + """Get Basic List Of Floats Get a list of floats @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[float]]: - r"""Get Basic List Of Floats + """Get Basic List Of Floats Get a list of floats diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py index ebb453096..800c29608 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[int]]: - r"""Get Basic List Of Integers + """Get Basic List Of Integers Get a list of integers @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[int]]: - r"""Get Basic List Of Integers + """Get Basic List Of Integers Get a list of integers @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[int]]: - r"""Get Basic List Of Integers + """Get Basic List Of Integers Get a list of integers @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[int]]: - r"""Get Basic List Of Integers + """Get Basic List Of Integers Get a list of integers diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py index 7f4106016..2a84b2b5e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py @@ -50,7 +50,7 @@ def sync_detailed( *, client: Client, ) -> Response[List[str]]: - r"""Get Basic List Of Strings + """Get Basic List Of Strings Get a list of strings @@ -78,7 +78,7 @@ def sync( *, client: Client, ) -> Optional[List[str]]: - r"""Get Basic List Of Strings + """Get Basic List Of Strings Get a list of strings @@ -99,7 +99,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[str]]: - r"""Get Basic List Of Strings + """Get Basic List Of Strings Get a list of strings @@ -125,7 +125,7 @@ async def asyncio( *, client: Client, ) -> Optional[List[str]]: - r"""Get Basic List Of Strings + """Get Basic List Of Strings Get a list of strings diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py index 15607c274..6cffd7741 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py @@ -115,7 +115,7 @@ def sync_detailed( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Response[Union[HTTPValidationError, List["AModel"]]]: - r"""Get List + """Get List Get a list of things @@ -157,7 +157,7 @@ def sync( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List["AModel"]]]: - r"""Get List + """Get List Get a list of things @@ -192,7 +192,7 @@ async def asyncio_detailed( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Response[Union[HTTPValidationError, List["AModel"]]]: - r"""Get List + """Get List Get a list of things @@ -232,7 +232,7 @@ async def asyncio( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List["AModel"]]]: - r"""Get List + """Get List Get a list of things diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py index 8566b4334..4e23476f5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py @@ -65,7 +65,7 @@ def sync_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Int Enum + """Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -96,7 +96,7 @@ def sync( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Int Enum + """Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -120,7 +120,7 @@ async def asyncio_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Int Enum + """Int Enum Args: int_enum (AnIntEnum): An enumeration. @@ -149,7 +149,7 @@ async def asyncio( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Int Enum + """Int Enum Args: int_enum (AnIntEnum): An enumeration. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py index 065c29bf6..383522958 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Json Body + """Json Body Try sending a JSON body @@ -93,7 +93,7 @@ def sync( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Json Body + """Json Body Try sending a JSON body @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Json Body + """Json Body Try sending a JSON body @@ -150,7 +150,7 @@ async def asyncio( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Json Body + """Json Body Try sending a JSON body diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py index 6e442b12c..933184d3f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - r"""No Response + """No Response Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -74,7 +74,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - r"""No Response + """No Response Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py index 94d567ebc..99859332e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py @@ -51,7 +51,7 @@ def sync_detailed( *, client: Client, ) -> Response[File]: - r"""Octet Stream + """Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -77,7 +77,7 @@ def sync( *, client: Client, ) -> Optional[File]: - r"""Octet Stream + """Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,7 +96,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[File]: - r"""Octet Stream + """Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -120,7 +120,7 @@ async def asyncio( *, client: Client, ) -> Optional[File]: - r"""Octet Stream + """Octet Stream Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py index 8cedf3c28..ff9e887f4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py @@ -52,7 +52,7 @@ def sync_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: - r"""Post form data + """Post form data Post form data @@ -82,7 +82,7 @@ async def asyncio_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: - r"""Post form data + """Post form data Post form data diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py index c1e86669e..46536a27a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data_inline.py @@ -52,7 +52,7 @@ def sync_detailed( client: Client, form_data: PostFormDataInlineData, ) -> Response[Any]: - r"""Post form data (inline schema) + """Post form data (inline schema) Post form data (inline schema) @@ -82,7 +82,7 @@ async def asyncio_detailed( client: Client, form_data: PostFormDataInlineData, ) -> Response[Any]: - r"""Post form data (inline schema) + """Post form data (inline schema) Post form data (inline schema) diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py index 3747deec0..6a1d178dc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py @@ -59,7 +59,7 @@ def sync_detailed( client: Client, json_body: str, ) -> Response[Union[HTTPValidationError, str]]: - r"""Json Body Which is String + """Json Body Which is String Args: json_body (str): @@ -90,7 +90,7 @@ def sync( client: Client, json_body: str, ) -> Optional[Union[HTTPValidationError, str]]: - r"""Json Body Which is String + """Json Body Which is String Args: json_body (str): @@ -114,7 +114,7 @@ async def asyncio_detailed( client: Client, json_body: str, ) -> Response[Union[HTTPValidationError, str]]: - r"""Json Body Which is String + """Json Body Which is String Args: json_body (str): @@ -143,7 +143,7 @@ async def asyncio( client: Client, json_body: str, ) -> Optional[Union[HTTPValidationError, str]]: - r"""Json Body Which is String + """Json Body Which is String Args: json_body (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py index 2f67cd6d4..d1533c0e1 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/test_inline_objects.py @@ -57,7 +57,7 @@ def sync_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: - r"""Test Inline Objects + """Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -88,7 +88,7 @@ def sync( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - r"""Test Inline Objects + """Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -112,7 +112,7 @@ async def asyncio_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: - r"""Test Inline Objects + """Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): @@ -141,7 +141,7 @@ async def asyncio( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - r"""Test Inline Objects + """Test Inline Objects Args: json_body (TestInlineObjectsJsonBody): diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py index ce77d920d..85d53d9da 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py @@ -54,7 +54,7 @@ def sync_detailed( client: Client, my_token: str, ) -> Response[Any]: - r"""TOKEN_WITH_COOKIE + """TOKEN_WITH_COOKIE Test optional cookie parameters @@ -87,7 +87,7 @@ async def asyncio_detailed( client: Client, my_token: str, ) -> Response[Any]: - r"""TOKEN_WITH_COOKIE + """TOKEN_WITH_COOKIE Test optional cookie parameters diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py index 0bdd93c34..2daec1319 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py @@ -48,7 +48,7 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: - r"""Unsupported Content + """Unsupported Content Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -74,7 +74,7 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: - r"""Unsupported Content + """Unsupported Content Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py index 421e72c1d..d00ec5e40 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_file_tests_upload_post.py @@ -60,7 +60,7 @@ def sync_detailed( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Upload File + """Upload File Upload a file @@ -93,7 +93,7 @@ def sync( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Upload File + """Upload File Upload a file @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Response[Union[Any, HTTPValidationError]]: - r"""Upload File + """Upload File Upload a file @@ -150,7 +150,7 @@ async def asyncio( client: Client, multipart_data: BodyUploadFileTestsUploadPost, ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Upload File + """Upload File Upload a file diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py index 898833e3c..34add0e4e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/tests/upload_multiple_files_tests_upload_post.py @@ -63,7 +63,7 @@ def sync_detailed( client: Client, multipart_data: List[File], ) -> Response[Union[Any, HTTPValidationError]]: - r"""Upload multiple files + """Upload multiple files Upload several files in the same request @@ -96,7 +96,7 @@ def sync( client: Client, multipart_data: List[File], ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Upload multiple files + """Upload multiple files Upload several files in the same request @@ -122,7 +122,7 @@ async def asyncio_detailed( client: Client, multipart_data: List[File], ) -> Response[Union[Any, HTTPValidationError]]: - r"""Upload multiple files + """Upload multiple files Upload several files in the same request @@ -153,7 +153,7 @@ async def asyncio( client: Client, multipart_data: List[File], ) -> Optional[Union[Any, HTTPValidationError]]: - r"""Upload multiple files + """Upload multiple files Upload several files in the same request diff --git a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py index c0b560f71..f8332a87a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py +++ b/end_to_end_tests/golden-record/my_test_api_client/api/true_/false_.py @@ -56,7 +56,7 @@ def sync_detailed( client: Client, import_: str, ) -> Response[Any]: - r""" + """ Args: import_ (str): @@ -86,7 +86,7 @@ async def asyncio_detailed( client: Client, import_: str, ) -> Response[Any]: - r""" + """ Args: import_ (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py index 827c287cf..958b24ab5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_form_data.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class AFormData: - r""" + """ Attributes: an_required_field (str): an_optional_field (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py index 62dd1fee3..9c1740dc8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model.py @@ -19,7 +19,7 @@ @attr.s(auto_attribs=True) class AModel: - r"""A Model for testing all the ways custom objects can be used + """A Model for testing all the ways custom objects can be used Attributes: an_enum_value (AnEnum): For testing Enums in all the ways they can be used diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py index 6a50fdf10..1f1c05565 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/a_model_with_properties_reference_that_are_not_object.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AModelWithPropertiesReferenceThatAreNotObject: - r""" + """ Attributes: enum_properties_ref (List[AnEnum]): str_properties_ref (List[str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py index 7554b9538..90918d021 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_has_properties_but_no_type.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class AllOfHasPropertiesButNoType: - r""" + """ Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py index fadc09c5e..5a46393fd 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class AllOfSubModel: - r""" + """ Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py index 59b31ee23..16fcbb88d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_a_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAItem: - r""" + """ Attributes: circular (Union[Unset, List['AnArrayWithACircularRefInItemsObjectBItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py index 0fe749f89..f03a87604 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_a_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem: - r""" """ + """ """ additional_properties: Dict[str, List["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py index a880805fc..cdff09b4b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_additional_properties_b_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectAdditionalPropertiesBItem: - r""" """ + """ """ additional_properties: Dict[str, List["AnArrayWithACircularRefInItemsObjectAdditionalPropertiesAItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py index 105566e48..b15bb0f7b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_circular_ref_in_items_object_b_item.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class AnArrayWithACircularRefInItemsObjectBItem: - r""" + """ Attributes: circular (Union[Unset, List['AnArrayWithACircularRefInItemsObjectAItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py index 50e843205..52341b8bc 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_additional_properties_item.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem: - r""" """ + """ """ additional_properties: Dict[str, List["AnArrayWithARecursiveRefInItemsObjectAdditionalPropertiesItem"]] = attr.ib( init=False, factory=dict diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py index fc04b3cd3..c14ee07c2 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_array_with_a_recursive_ref_in_items_object_item.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class AnArrayWithARecursiveRefInItemsObjectItem: - r""" + """ Attributes: recursive (Union[Unset, List['AnArrayWithARecursiveRefInItemsObjectItem']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py index 4cb522aa8..c339eebd3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/another_all_of_sub_model.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class AnotherAllOfSubModel: - r""" + """ Attributes: another_sub_property (Union[Unset, str]): type (Union[Unset, AnotherAllOfSubModelType]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py index c1b0dd92d..d858be5b6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post.py @@ -27,7 +27,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPost: - r""" + """ Attributes: some_file (File): some_object (BodyUploadFileTestsUploadPostSomeObject): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py index 65ce0a622..522355858 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_additional_property.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostAdditionalProperty: - r""" + """ Attributes: foo (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py index 36d71ea54..e809b413e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_nullable_object.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeNullableObject: - r""" + """ Attributes: bar (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py index 3739537e1..8a4f123de 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_object.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeObject: - r""" + """ Attributes: num (float): text (str): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py index 55fc40e11..a32d5f979 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/body_upload_file_tests_upload_post_some_optional_object.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeOptionalObject: - r""" + """ Attributes: foo (str): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py index f4d287280..f8cc2151c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class FreeFormModel: - r""" """ + """ """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py b/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py index 62f81f2e0..4d8e71670 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/http_validation_error.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class HTTPValidationError: - r""" + """ Attributes: detail (Union[Unset, List['ValidationError']]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/import_.py b/end_to_end_tests/golden-record/my_test_api_client/models/import_.py index 040f55f89..276a4f21b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/import_.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/import_.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class Import: - r""" """ + """ """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py index 21112254e..3dfc48a36 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_from_all_of.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelFromAllOf: - r""" + """ Attributes: a_sub_property (Union[Unset, str]): type (Union[Unset, AnotherAllOfSubModelType]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py index 6fa843d49..c87d4c208 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_name.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelName: - r""" """ + """ """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py index 6f5070cab..15bab8de5 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_reference_with_periods.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelReferenceWithPeriods: - r"""A Model with periods in its reference""" + """A Model with periods in its reference""" additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py index ce8415a12..fb8ad21a8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined.py @@ -15,7 +15,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlined: - r""" + """ Attributes: a_number (Union[Unset, float]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py index 06886b3a0..66b487c00 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_inlined_additional_property.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlinedAdditionalProperty: - r""" + """ Attributes: extra_props_prop (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py index 59dcdb0cd..d51c5d72c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesRefed: - r""" """ + """ """ additional_properties: Dict[str, AnEnum] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py index d4a613e2e..d28dbb30e 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonProperties: - r""" """ + """ """ additional_properties: Dict[ str, Union["ModelWithAnyJsonPropertiesAdditionalPropertyType0", List[str], bool, float, int, str] diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py index 4ae2bdba4..19e863fc4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_any_json_properties_additional_property_type_0.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonPropertiesAdditionalPropertyType0: - r""" """ + """ """ additional_properties: Dict[str, str] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py index 834746187..ce52302f0 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py @@ -7,9 +7,9 @@ @attr.s(auto_attribs=True) class ModelWithBackslashInDescription: - r"""Description with special character: \ + r""" Description with special character: \ - """ + """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py index 0bc21f7f0..11e31983d 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_a.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefA: - r""" + """ Attributes: circular (Union[Unset, ModelWithCircularRefB]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py index 69f0b8fb4..5fb34f4f4 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_b.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefB: - r""" + """ Attributes: circular (Union[Unset, ModelWithCircularRefA]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py index d5fbbdf6b..0d9e0155c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_a.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefInAdditionalPropertiesA: - r""" """ + """ """ additional_properties: Dict[str, "ModelWithCircularRefInAdditionalPropertiesB"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py index fae5af988..0583b40f8 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_circular_ref_in_additional_properties_b.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithCircularRefInAdditionalPropertiesB: - r""" """ + """ """ additional_properties: Dict[str, "ModelWithCircularRefInAdditionalPropertiesA"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py index d0f5d9e2c..1dfc6d406 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_date_time_property.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithDateTimeProperty: - r""" + """ Attributes: datetime_ (Union[Unset, datetime.datetime]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py index 856147949..89144cfec 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py @@ -15,7 +15,7 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalProperties: - r""" + """ Attributes: a_date_holder (Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py index 8f658f3a9..aa8a25252 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties_a_date_holder.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalPropertiesADateHolder: - r""" """ + """ """ additional_properties: Dict[str, datetime.datetime] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py index 0e43ce411..d1b8b2b11 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_property_ref.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class ModelWithPropertyRef: - r""" + """ Attributes: inner (Union[Unset, ModelName]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py index ddba0f0fe..b60e5a100 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithRecursiveRef: - r""" + """ Attributes: recursive (Union[Unset, ModelWithRecursiveRef]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py index 58ec1b07d..64d327ee6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_recursive_ref_in_additional_properties.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ModelWithRecursiveRefInAdditionalProperties: - r""" """ + """ """ additional_properties: Dict[str, "ModelWithRecursiveRefInAdditionalProperties"] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py index bbe197ed8..e1fd0cf5b 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py @@ -11,7 +11,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionProperty: - r""" + """ Attributes: a_property (Union[AnEnum, AnIntEnum, Unset]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py index 828cfb5a8..0c6cb6d3a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined.py @@ -14,7 +14,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlined: - r""" + """ Attributes: fruit (Union['ModelWithUnionPropertyInlinedFruitType0', 'ModelWithUnionPropertyInlinedFruitType1', Unset]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py index 9fa44db89..466bfe252 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_0.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType0: - r""" + """ Attributes: apples (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py index f4826b3d7..a0dae4331 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property_inlined_fruit_type_1.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType1: - r""" + """ Attributes: bananas (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/none.py b/end_to_end_tests/golden-record/my_test_api_client/models/none.py index a8cde36e6..e1722f094 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/none.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/none.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class None_: - r""" """ + """ """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py index 0642bd41c..baac858b3 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_form_data_inline_data.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class PostFormDataInlineData: - r""" + """ Attributes: a_required_field (str): an_optional_field (Union[Unset, str]): diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py index 8c6896ac6..579c4dbd6 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class PostResponsesUnionsSimpleBeforeComplexResponse200: - r""" + """ Attributes: a (Union['PostResponsesUnionsSimpleBeforeComplexResponse200AType1', str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py index aae28a71f..6b9ae2484 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/post_responses_unions_simple_before_complex_response_200a_type_1.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostResponsesUnionsSimpleBeforeComplexResponse200AType1: - r""" """ + """ """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py index 07ba6cdce..66f8ce42c 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_json_body.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class TestInlineObjectsJsonBody: - r""" + """ Attributes: a_property (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py index 72a27e05d..3f9c1c944 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class TestInlineObjectsResponse200: - r""" + """ Attributes: a_property (Union[Unset, str]): """ diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py b/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py index 347af8cf3..e2f6539ee 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/validation_error.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class ValidationError: - r""" + """ Attributes: loc (List[str]): msg (str): diff --git a/end_to_end_tests/openapi.json b/end_to_end_tests/openapi.json index ef9fff702..11baa0cc5 100644 --- a/end_to_end_tests/openapi.json +++ b/end_to_end_tests/openapi.json @@ -1229,6 +1229,21 @@ } } } + }, + "/tests/description-with-backslash": { + "get": { + "tags": [ + "tests" + ], + "summary": "Test description with \\", + "description": "Test description with \\", + "operationId": "description_with_backslash", + "responses": { + "200": { + "description": "Successful response" + } + } + } } }, "components": { diff --git a/integration-tests/integration_tests/__init__.py b/integration-tests/integration_tests/__init__.py index bbf16a83b..0dd5b4913 100644 --- a/integration-tests/integration_tests/__init__.py +++ b/integration-tests/integration_tests/__init__.py @@ -1,4 +1,5 @@ -r""" A client library for accessing OpenAPI Test Server """ +""" A client library for accessing OpenAPI Test Server """ + from .client import AuthenticatedClient, Client __all__ = ( diff --git a/integration-tests/integration_tests/api/body/post_body_multipart.py b/integration-tests/integration_tests/api/body/post_body_multipart.py index dcdd4a8cd..303443af7 100644 --- a/integration-tests/integration_tests/api/body/post_body_multipart.py +++ b/integration-tests/integration_tests/api/body/post_body_multipart.py @@ -66,7 +66,7 @@ def sync_detailed( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Response[Union[PostBodyMultipartResponse200, PublicError]]: - r""" + """ Args: multipart_data (PostBodyMultipartMultipartData): @@ -96,7 +96,7 @@ def sync( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Optional[Union[PostBodyMultipartResponse200, PublicError]]: - r""" + """ Args: multipart_data (PostBodyMultipartMultipartData): @@ -119,7 +119,7 @@ async def asyncio_detailed( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Response[Union[PostBodyMultipartResponse200, PublicError]]: - r""" + """ Args: multipart_data (PostBodyMultipartMultipartData): @@ -147,7 +147,7 @@ async def asyncio( client: Client, multipart_data: PostBodyMultipartMultipartData, ) -> Optional[Union[PostBodyMultipartResponse200, PublicError]]: - r""" + """ Args: multipart_data (PostBodyMultipartMultipartData): diff --git a/integration-tests/integration_tests/api/parameters/post_parameters_header.py b/integration-tests/integration_tests/api/parameters/post_parameters_header.py index 012da5849..c89c4c304 100644 --- a/integration-tests/integration_tests/api/parameters/post_parameters_header.py +++ b/integration-tests/integration_tests/api/parameters/post_parameters_header.py @@ -76,7 +76,7 @@ def sync_detailed( number_header: float, integer_header: int, ) -> Response[Union[PostParametersHeaderResponse200, PublicError]]: - r""" + """ Args: boolean_header (bool): string_header (str): @@ -115,7 +115,7 @@ def sync( number_header: float, integer_header: int, ) -> Optional[Union[PostParametersHeaderResponse200, PublicError]]: - r""" + """ Args: boolean_header (bool): string_header (str): @@ -147,7 +147,7 @@ async def asyncio_detailed( number_header: float, integer_header: int, ) -> Response[Union[PostParametersHeaderResponse200, PublicError]]: - r""" + """ Args: boolean_header (bool): string_header (str): @@ -184,7 +184,7 @@ async def asyncio( number_header: float, integer_header: int, ) -> Optional[Union[PostParametersHeaderResponse200, PublicError]]: - r""" + """ Args: boolean_header (bool): string_header (str): diff --git a/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py b/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py index d63711c27..1c7f6f651 100644 --- a/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py +++ b/integration-tests/integration_tests/models/post_body_multipart_multipart_data.py @@ -10,7 +10,7 @@ @attr.s(auto_attribs=True) class PostBodyMultipartMultipartData: - r""" + """ Attributes: a_string (str): file (File): For the sake of this test, include a file name and content type. The payload should also be valid diff --git a/integration-tests/integration_tests/models/post_body_multipart_response_200.py b/integration-tests/integration_tests/models/post_body_multipart_response_200.py index 1e5b1a2e8..319c25fd0 100644 --- a/integration-tests/integration_tests/models/post_body_multipart_response_200.py +++ b/integration-tests/integration_tests/models/post_body_multipart_response_200.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostBodyMultipartResponse200: - r""" + """ Attributes: a_string (str): Echo of the 'a_string' input parameter from the form. file_data (str): Echo of content of the 'file' input parameter from the form. diff --git a/integration-tests/integration_tests/models/post_parameters_header_response_200.py b/integration-tests/integration_tests/models/post_parameters_header_response_200.py index 8723c9a97..772ffad3e 100644 --- a/integration-tests/integration_tests/models/post_parameters_header_response_200.py +++ b/integration-tests/integration_tests/models/post_parameters_header_response_200.py @@ -7,7 +7,7 @@ @attr.s(auto_attribs=True) class PostParametersHeaderResponse200: - r""" + """ Attributes: boolean (bool): Echo of the 'Boolean-Header' input parameter from the header. string (str): Echo of the 'String-Header' input parameter from the header. diff --git a/integration-tests/integration_tests/models/problem.py b/integration-tests/integration_tests/models/problem.py index 8dda0495a..d343123ab 100644 --- a/integration-tests/integration_tests/models/problem.py +++ b/integration-tests/integration_tests/models/problem.py @@ -9,7 +9,7 @@ @attr.s(auto_attribs=True) class Problem: - r""" + """ Attributes: parameter_name (Union[Unset, str]): description (Union[Unset, str]): diff --git a/integration-tests/integration_tests/models/public_error.py b/integration-tests/integration_tests/models/public_error.py index e6c3ede63..d5281d8ff 100644 --- a/integration-tests/integration_tests/models/public_error.py +++ b/integration-tests/integration_tests/models/public_error.py @@ -13,7 +13,7 @@ @attr.s(auto_attribs=True) class PublicError: - r""" + """ Attributes: errors (Union[Unset, List[str]]): extra_parameters (Union[Unset, List[str]]): diff --git a/openapi_python_client/templates/endpoint_macros.py.jinja b/openapi_python_client/templates/endpoint_macros.py.jinja index e897f3069..fde2e018a 100644 --- a/openapi_python_client/templates/endpoint_macros.py.jinja +++ b/openapi_python_client/templates/endpoint_macros.py.jinja @@ -1,4 +1,5 @@ {% from "property_templates/helpers.jinja" import guarded_statement %} +{% from "helpers.jinja" import safe_docstring %} {% macro header_params(endpoint) %} {% if endpoint.header_parameters %} @@ -140,8 +141,8 @@ json_body=json_body, {% endfor %} {% endmacro %} -{% macro docstring(endpoint, return_string) %} -r"""{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}} +{% macro docstring_content(endpoint, return_string) %} +{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}} {% endif -%} {%- if endpoint.description %} {{ endpoint.description | wordwrap(100) }} @@ -165,5 +166,8 @@ Raises: Returns: Response[{{ return_string }}] -""" +{% endmacro %} + +{% macro docstring(endpoint, return_string) %} +{{ safe_docstring(docstring_content(endpoint, return_string)) }} {% endmacro %} diff --git a/openapi_python_client/templates/helpers.jinja b/openapi_python_client/templates/helpers.jinja new file mode 100644 index 000000000..bbb95179c --- /dev/null +++ b/openapi_python_client/templates/helpers.jinja @@ -0,0 +1,8 @@ +{% macro safe_docstring(content) %} +{# This macro returns the provided content as a docstring, set to a raw string if it contains a backslash #} +{% if '\\' in content %} +r""" {{ content }} """ +{% else %} +""" {{ content }} """ +{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 5e38a296e..2d229dcf9 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -31,11 +31,12 @@ if TYPE_CHECKING: {% set class_name = model.class_info.name %} {% set module_name = model.class_info.module_name %} +{% from "helpers.jinja" import safe_docstring %} + T = TypeVar("T", bound="{{ class_name }}") -@attr.s(auto_attribs=True) -class {{ class_name }}: - r"""{% if model.title %}{{ model.title | wordwrap(116) }} +{% macro class_docstring_content(model) %} + {% if model.title %}{{ model.title | wordwrap(116) }} {% endif -%} {%- if model.description %}{{ model.description | wordwrap(116) }} @@ -55,7 +56,11 @@ class {{ class_name }}: {% for property in model.required_properties + model.optional_properties %} {{ property.to_docstring() | wordwrap(112) | indent(12) }} {% endfor %}{% endif %} - """ +{% endmacro %} + +@attr.s(auto_attribs=True) +class {{ class_name }}: + {{ safe_docstring(class_docstring_content(model)) }} {% for property in model.required_properties + model.optional_properties %} {% if property.default is none and property.required %} diff --git a/openapi_python_client/templates/package_init.py.jinja b/openapi_python_client/templates/package_init.py.jinja index 17df5ae05..ecf60e74d 100644 --- a/openapi_python_client/templates/package_init.py.jinja +++ b/openapi_python_client/templates/package_init.py.jinja @@ -1,4 +1,6 @@ -r""" {{ package_description }} """ +{% from "helpers.jinja" import safe_docstring %} + +{{ safe_docstring(package_description) }} from .client import AuthenticatedClient, Client __all__ = ( From 5ef12813fc169e690c6c126102f058c1243dbeff Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Sat, 18 Mar 2023 16:31:49 -0600 Subject: [PATCH 4/4] style: Fix some weird formatting when backslash ends a docstring --- .../golden-record/my_test_api_client/__init__.py | 1 - .../models/model_with_backslash_in_description.py | 2 +- integration-tests/integration_tests/__init__.py | 1 - openapi_python_client/templates/helpers.jinja | 6 +++--- openapi_python_client/templates/model.py.jinja | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/end_to_end_tests/golden-record/my_test_api_client/__init__.py b/end_to_end_tests/golden-record/my_test_api_client/__init__.py index 701fe7dcb..530928e7a 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/__init__.py +++ b/end_to_end_tests/golden-record/my_test_api_client/__init__.py @@ -1,5 +1,4 @@ """ A client library for accessing My Test API """ - from .client import AuthenticatedClient, Client __all__ = ( diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py index ce52302f0..d52952236 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_backslash_in_description.py @@ -9,7 +9,7 @@ class ModelWithBackslashInDescription: r""" Description with special character: \ - """ + """ additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) diff --git a/integration-tests/integration_tests/__init__.py b/integration-tests/integration_tests/__init__.py index 0dd5b4913..48f0fb8da 100644 --- a/integration-tests/integration_tests/__init__.py +++ b/integration-tests/integration_tests/__init__.py @@ -1,5 +1,4 @@ """ A client library for accessing OpenAPI Test Server """ - from .client import AuthenticatedClient, Client __all__ = ( diff --git a/openapi_python_client/templates/helpers.jinja b/openapi_python_client/templates/helpers.jinja index bbb95179c..180613c02 100644 --- a/openapi_python_client/templates/helpers.jinja +++ b/openapi_python_client/templates/helpers.jinja @@ -1,8 +1,8 @@ {% macro safe_docstring(content) %} {# This macro returns the provided content as a docstring, set to a raw string if it contains a backslash #} -{% if '\\' in content %} +{% if '\\' in content -%} r""" {{ content }} """ -{% else %} +{%- else -%} """ {{ content }} """ -{% endif %} +{%- endif -%} {% endmacro %} \ No newline at end of file diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index 2d229dcf9..3b2763d68 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -60,7 +60,7 @@ T = TypeVar("T", bound="{{ class_name }}") @attr.s(auto_attribs=True) class {{ class_name }}: - {{ safe_docstring(class_docstring_content(model)) }} + {{ safe_docstring(class_docstring_content(model)) | indent(4) }} {% for property in model.required_properties + model.optional_properties %} {% if property.default is none and property.required %}