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 f7df7582f..b0d1b43c0 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 @@ -44,6 +44,13 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + Args: + common (Union[Unset, None, str]): None: + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, common=common, @@ -62,6 +69,15 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + + Args: + common (Union[Unset, None, str]): None: + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, common=common, 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 9f9981bc5..1d7b97879 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 @@ -44,6 +44,13 @@ def sync_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + Args: + common (Union[Unset, None, str]): None: + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, common=common, @@ -62,6 +69,15 @@ async def asyncio_detailed( client: Client, common: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + + Args: + common (Union[Unset, None, str]): None: + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, common=common, 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 89ecdac23..a6032fb58 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 @@ -68,6 +68,16 @@ def sync_detailed( null_not_required: Union[Unset, None, datetime.datetime] = UNSET, not_null_not_required: Union[Unset, None, datetime.datetime] = UNSET, ) -> Response[Any]: + """ + + Args: + not_null_required (datetime.datetime): None: + null_required (Union[Unset, None, datetime.datetime]): None: + null_not_required (Union[Unset, None, datetime.datetime]): None: + not_null_not_required (Union[Unset, None, datetime.datetime]): None: + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, not_null_required=not_null_required, @@ -92,6 +102,18 @@ 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]: + """ + + + Args: + not_null_required (datetime.datetime): None: + null_required (Union[Unset, None, datetime.datetime]): None: + null_not_required (Union[Unset, None, datetime.datetime]): None: + not_null_not_required (Union[Unset, None, datetime.datetime]): None: + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, not_null_required=not_null_required, 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 a415417e5..8b30c0fdd 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 @@ -46,6 +46,13 @@ def sync_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + Args: + param_query (Union[Unset, None, str]): None: + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, @@ -66,6 +73,15 @@ async def asyncio_detailed( client: Client, param_query: Union[Unset, None, str] = UNSET, ) -> Response[Any]: + """ + + + Args: + param_query (Union[Unset, None, str]): None: + + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, 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 78eb855da..9c93ec204 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 @@ -46,6 +46,13 @@ def sync_detailed( client: Client, param_query: str = "overriden_in_GET", ) -> Response[Any]: + """ + + Args: + param_query (str): None|default: 'overriden_in_GET': + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, @@ -66,6 +73,15 @@ async def asyncio_detailed( client: Client, param_query: str = "overriden_in_GET", ) -> Response[Any]: + """ + + + Args: + param_query (str): None|default: 'overriden_in_GET': + + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, 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 067032a7f..c95022ebd 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 @@ -56,6 +56,15 @@ def sync_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: + """ + + Args: + param_query (Union[Unset, None, str]): None: + param_header (Union[Unset, str]): None, + param_cookie (Union[Unset, str]): None, + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, @@ -80,6 +89,17 @@ async def asyncio_detailed( param_header: Union[Unset, str] = UNSET, param_cookie: Union[Unset, str] = UNSET, ) -> Response[Any]: + """ + + + Args: + param_query (Union[Unset, None, str]): None: + param_header (Union[Unset, str]): None, + param_cookie (Union[Unset, str]): None, + + Returns: + Response[Any] + """ kwargs = _get_kwargs( param_path=param_path, client=client, 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 db68369c3..9fc68ef7c 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 @@ -46,6 +46,11 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: + """ + + Returns: + Response[Any] + """ kwargs = _get_kwargs( param4=param4, param2=param2, @@ -70,6 +75,13 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: + """ + + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( param4=param4, param2=param2, 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 322429ec6..12d89fab3 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 @@ -36,6 +36,11 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: + """ + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) @@ -52,6 +57,13 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: + """ + + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) 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 74d6fc26c..9c36c5fb4 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 @@ -119,6 +119,25 @@ def sync_detailed( model_prop: ModelWithUnionProperty, required_model_prop: ModelWithUnionProperty, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Defaults + + + Args: + string_prop (str): None|default: 'the default string': + date_prop (datetime.date): None|default: isoparse('1010-10-10').date(): + float_prop (float): None|default: 3.14: + int_prop (int): None|default: 7: + boolean_prop (bool): None: + list_prop (List[AnEnum]): None: + union_prop (Union[float, str]): None|default: 'not a float': + union_prop_with_ref (Union[AnEnum, None, Unset, float]): None|default: 0.6: + enum_prop (AnEnum): For testing Enums in all the ways they can be used : + model_prop (ModelWithUnionProperty): : + required_model_prop (ModelWithUnionProperty): : + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, string_prop=string_prop, @@ -157,8 +176,26 @@ def sync( model_prop: ModelWithUnionProperty, required_model_prop: ModelWithUnionProperty, ) -> Optional[Union[Any, HTTPValidationError]]: - """ """ - + """ + Defaults + + + + Args: + string_prop (str): None|default: 'the default string': + date_prop (datetime.date): None|default: isoparse('1010-10-10').date(): + float_prop (float): None|default: 3.14: + int_prop (int): None|default: 7: + boolean_prop (bool): None: + list_prop (List[AnEnum]): None: + union_prop (Union[float, str]): None|default: 'not a float': + union_prop_with_ref (Union[AnEnum, None, Unset, float]): None|default: 0.6: + enum_prop (AnEnum): For testing Enums in all the ways they can be used : + model_prop (ModelWithUnionProperty): : + required_model_prop (ModelWithUnionProperty): : + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return sync_detailed( client=client, string_prop=string_prop, @@ -190,6 +227,27 @@ async def asyncio_detailed( model_prop: ModelWithUnionProperty, required_model_prop: ModelWithUnionProperty, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Defaults + + + + Args: + string_prop (str): None|default: 'the default string': + date_prop (datetime.date): None|default: isoparse('1010-10-10').date(): + float_prop (float): None|default: 3.14: + int_prop (int): None|default: 7: + boolean_prop (bool): None: + list_prop (List[AnEnum]): None: + union_prop (Union[float, str]): None|default: 'not a float': + union_prop_with_ref (Union[AnEnum, None, Unset, float]): None|default: 0.6: + enum_prop (AnEnum): For testing Enums in all the ways they can be used : + model_prop (ModelWithUnionProperty): : + required_model_prop (ModelWithUnionProperty): : + + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, string_prop=string_prop, @@ -226,8 +284,27 @@ async def asyncio( model_prop: ModelWithUnionProperty, required_model_prop: ModelWithUnionProperty, ) -> Optional[Union[Any, HTTPValidationError]]: - """ """ - + """ + Defaults + + + + + Args: + string_prop (str): None|default: 'the default string': + date_prop (datetime.date): None|default: isoparse('1010-10-10').date(): + float_prop (float): None|default: 3.14: + int_prop (int): None|default: 7: + boolean_prop (bool): None: + list_prop (List[AnEnum]): None: + union_prop (Union[float, str]): None|default: 'not a float': + union_prop_with_ref (Union[AnEnum, None, Unset, float]): None|default: 0.6: + enum_prop (AnEnum): For testing Enums in all the ways they can be used : + model_prop (ModelWithUnionProperty): : + required_model_prop (ModelWithUnionProperty): : + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return ( await asyncio_detailed( client=client, 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 243e145c6..9a8bced9c 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 @@ -44,6 +44,13 @@ def sync_detailed( *, client: Client, ) -> Response[List[bool]]: + """ + Get Basic List Of Booleans + + Get a list of booleans + Returns: + Response[List[bool]] + """ kwargs = _get_kwargs( client=client, ) @@ -60,8 +67,14 @@ def sync( *, client: Client, ) -> Optional[List[bool]]: - """Get a list of booleans""" + """ + Get Basic List Of Booleans + + Get a list of booleans + Returns: + Optional[List[bool]] + """ return sync_detailed( client=client, ).parsed @@ -71,6 +84,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[bool]]: + """ + Get Basic List Of Booleans + + Get a list of booleans + + + Returns: + Response[List[bool]] + """ kwargs = _get_kwargs( client=client, ) @@ -85,8 +107,14 @@ async def asyncio( *, client: Client, ) -> Optional[List[bool]]: - """Get a list of booleans""" + """ + Get Basic List Of Booleans + + Get a list of booleans + Returns: + Optional[List[bool]] + """ return ( await asyncio_detailed( client=client, 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 99200c0b8..5e798351b 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 @@ -44,6 +44,13 @@ def sync_detailed( *, client: Client, ) -> Response[List[float]]: + """ + Get Basic List Of Floats + + Get a list of floats + Returns: + Response[List[float]] + """ kwargs = _get_kwargs( client=client, ) @@ -60,8 +67,14 @@ def sync( *, client: Client, ) -> Optional[List[float]]: - """Get a list of floats""" + """ + Get Basic List Of Floats + + Get a list of floats + Returns: + Optional[List[float]] + """ return sync_detailed( client=client, ).parsed @@ -71,6 +84,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[float]]: + """ + Get Basic List Of Floats + + Get a list of floats + + + Returns: + Response[List[float]] + """ kwargs = _get_kwargs( client=client, ) @@ -85,8 +107,14 @@ async def asyncio( *, client: Client, ) -> Optional[List[float]]: - """Get a list of floats""" + """ + Get Basic List Of Floats + + Get a list of floats + Returns: + Optional[List[float]] + """ return ( await asyncio_detailed( client=client, 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 cfb47195a..3c4c8ad37 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 @@ -44,6 +44,13 @@ def sync_detailed( *, client: Client, ) -> Response[List[int]]: + """ + Get Basic List Of Integers + + Get a list of integers + Returns: + Response[List[int]] + """ kwargs = _get_kwargs( client=client, ) @@ -60,8 +67,14 @@ def sync( *, client: Client, ) -> Optional[List[int]]: - """Get a list of integers""" + """ + Get Basic List Of Integers + + Get a list of integers + Returns: + Optional[List[int]] + """ return sync_detailed( client=client, ).parsed @@ -71,6 +84,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[int]]: + """ + Get Basic List Of Integers + + Get a list of integers + + + Returns: + Response[List[int]] + """ kwargs = _get_kwargs( client=client, ) @@ -85,8 +107,14 @@ async def asyncio( *, client: Client, ) -> Optional[List[int]]: - """Get a list of integers""" + """ + Get Basic List Of Integers + + Get a list of integers + Returns: + Optional[List[int]] + """ return ( await asyncio_detailed( client=client, 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 9a2542862..2f53bd8e8 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 @@ -44,6 +44,13 @@ def sync_detailed( *, client: Client, ) -> Response[List[str]]: + """ + Get Basic List Of Strings + + Get a list of strings + Returns: + Response[List[str]] + """ kwargs = _get_kwargs( client=client, ) @@ -60,8 +67,14 @@ def sync( *, client: Client, ) -> Optional[List[str]]: - """Get a list of strings""" + """ + Get Basic List Of Strings + + Get a list of strings + Returns: + Optional[List[str]] + """ return sync_detailed( client=client, ).parsed @@ -71,6 +84,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[List[str]]: + """ + Get Basic List Of Strings + + Get a list of strings + + + Returns: + Response[List[str]] + """ kwargs = _get_kwargs( client=client, ) @@ -85,8 +107,14 @@ async def asyncio( *, client: Client, ) -> Optional[List[str]]: - """Get a list of strings""" + """ + Get Basic List Of Strings + + Get a list of strings + Returns: + Optional[List[str]] + """ return ( await asyncio_detailed( client=client, 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 24410bef0..0b13f3c05 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 @@ -100,6 +100,16 @@ 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 + + Get a list of things + Args: + an_enum_value (List[AnEnum]): None: + some_date (Union[datetime.date, datetime.datetime]): None: + Returns: + Response[Union[HTTPValidationError, List[AModel]]] + """ kwargs = _get_kwargs( client=client, an_enum_value=an_enum_value, @@ -124,8 +134,17 @@ def sync( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List[AModel]]]: - """Get a list of things""" + """ + Get List + Get a list of things + + Args: + an_enum_value (List[AnEnum]): None: + some_date (Union[datetime.date, datetime.datetime]): None: + Returns: + Optional[Union[HTTPValidationError, List[AModel]]] + """ return sync_detailed( client=client, an_enum_value=an_enum_value, @@ -143,6 +162,18 @@ 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 + + Get a list of things + + Args: + an_enum_value (List[AnEnum]): None: + some_date (Union[datetime.date, datetime.datetime]): None: + + Returns: + Response[Union[HTTPValidationError, List[AModel]]] + """ kwargs = _get_kwargs( client=client, an_enum_value=an_enum_value, @@ -165,8 +196,18 @@ async def asyncio( an_enum_value_with_only_null: List[None], some_date: Union[datetime.date, datetime.datetime], ) -> Optional[Union[HTTPValidationError, List[AModel]]]: - """Get a list of things""" + """ + Get List + + Get a list of things + + Args: + an_enum_value (List[AnEnum]): None: + some_date (Union[datetime.date, datetime.datetime]): None: + Returns: + Optional[Union[HTTPValidationError, List[AModel]]] + """ return ( await asyncio_detailed( client=client, 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 3f0ce55ac..6734c5d00 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 @@ -60,6 +60,15 @@ def sync_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Int Enum + + + Args: + int_enum (AnIntEnum): An enumeration.: + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, int_enum=int_enum, @@ -78,8 +87,16 @@ def sync( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - """ """ + """ + Int Enum + + + Args: + int_enum (AnIntEnum): An enumeration.: + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return sync_detailed( client=client, int_enum=int_enum, @@ -91,6 +108,17 @@ async def asyncio_detailed( client: Client, int_enum: AnIntEnum, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Int Enum + + + + Args: + int_enum (AnIntEnum): An enumeration.: + + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, int_enum=int_enum, @@ -107,8 +135,17 @@ async def asyncio( client: Client, int_enum: AnIntEnum, ) -> Optional[Union[Any, HTTPValidationError]]: - """ """ + """ + Int Enum + + + + Args: + int_enum (AnIntEnum): An enumeration.: + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return ( await asyncio_detailed( client=client, 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 e74b82581..be15601a0 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 @@ -55,6 +55,13 @@ def sync_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Json Body + + Try sending a JSON body + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, json_body=json_body, @@ -73,8 +80,14 @@ def sync( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Try sending a JSON body""" + """ + Json Body + + Try sending a JSON body + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return sync_detailed( client=client, json_body=json_body, @@ -86,6 +99,15 @@ async def asyncio_detailed( client: Client, json_body: AModel, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Json Body + + Try sending a JSON body + + + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, json_body=json_body, @@ -102,8 +124,14 @@ async def asyncio( client: Client, json_body: AModel, ) -> Optional[Union[Any, HTTPValidationError]]: - """Try sending a JSON body""" + """ + Json Body + + Try sending a JSON body + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return ( await asyncio_detailed( client=client, 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 598632a49..c629f3de2 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 @@ -36,6 +36,13 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: + """ + No Response + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) @@ -52,6 +59,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: + """ + No Response + + + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) 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 34405a2b0..f788550fe 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 @@ -45,6 +45,13 @@ def sync_detailed( *, client: Client, ) -> Response[File]: + """ + Octet Stream + + + Returns: + Response[File] + """ kwargs = _get_kwargs( client=client, ) @@ -61,8 +68,14 @@ def sync( *, client: Client, ) -> Optional[File]: - """ """ + """ + Octet Stream + + + Returns: + Optional[File] + """ return sync_detailed( client=client, ).parsed @@ -72,6 +85,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[File]: + """ + Octet Stream + + + + + Returns: + Response[File] + """ kwargs = _get_kwargs( client=client, ) @@ -86,8 +108,14 @@ async def asyncio( *, client: Client, ) -> Optional[File]: - """ """ + """ + Octet Stream + + + Returns: + Optional[File] + """ return ( await asyncio_detailed( client=client, 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 ecd55c9e7..98bde1383 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 @@ -40,6 +40,13 @@ def sync_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: + """ + Post from data + + Post form data + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, form_data=form_data, @@ -58,6 +65,15 @@ async def asyncio_detailed( client: Client, form_data: AFormData, ) -> Response[Any]: + """ + Post from data + + Post form data + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, form_data=form_data, 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 655150038..6bc0fa5e7 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 @@ -51,6 +51,13 @@ def sync_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: + """ + Test Inline Objects + + + Returns: + Response[TestInlineObjectsResponse200] + """ kwargs = _get_kwargs( client=client, json_body=json_body, @@ -69,8 +76,14 @@ def sync( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - """ """ + """ + Test Inline Objects + + + Returns: + Optional[TestInlineObjectsResponse200] + """ return sync_detailed( client=client, json_body=json_body, @@ -82,6 +95,15 @@ async def asyncio_detailed( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Response[TestInlineObjectsResponse200]: + """ + Test Inline Objects + + + + + Returns: + Response[TestInlineObjectsResponse200] + """ kwargs = _get_kwargs( client=client, json_body=json_body, @@ -98,8 +120,14 @@ async def asyncio( client: Client, json_body: TestInlineObjectsJsonBody, ) -> Optional[TestInlineObjectsResponse200]: - """ """ + """ + Test Inline Objects + + + Returns: + Optional[TestInlineObjectsResponse200] + """ return ( await asyncio_detailed( client=client, 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 2b9191822..6c70e2833 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 @@ -40,6 +40,15 @@ def sync_detailed( client: Client, my_token: str, ) -> Response[Any]: + """ + TOKEN_WITH_COOKIE + + Test optional cookie parameters + Args: + my_token (str): None, + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, my_token=my_token, @@ -58,6 +67,17 @@ async def asyncio_detailed( client: Client, my_token: str, ) -> Response[Any]: + """ + TOKEN_WITH_COOKIE + + Test optional cookie parameters + + Args: + my_token (str): None, + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, my_token=my_token, 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 84f1581d5..ee7318dce 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 @@ -36,6 +36,13 @@ def sync_detailed( *, client: Client, ) -> Response[Any]: + """ + Unsupported Content + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) @@ -52,6 +59,15 @@ async def asyncio_detailed( *, client: Client, ) -> Response[Any]: + """ + Unsupported Content + + + + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, ) 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 652d8c323..0a1f821fa 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,6 +60,15 @@ def sync_detailed( multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Union[Unset, bool] = UNSET, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Upload File + + Upload a file + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, multipart_data=multipart_data, @@ -80,8 +89,16 @@ def sync( multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Union[Unset, bool] = UNSET, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload a file""" + """ + Upload File + Upload a file + + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return sync_detailed( client=client, multipart_data=multipart_data, @@ -95,6 +112,17 @@ async def asyncio_detailed( multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Union[Unset, bool] = UNSET, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Upload File + + Upload a file + + Args: + keep_alive (Union[Unset, bool]): None, + + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, multipart_data=multipart_data, @@ -113,8 +141,17 @@ async def asyncio( multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Union[Unset, bool] = UNSET, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload a file""" + """ + Upload File + + Upload a file + + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return ( await asyncio_detailed( client=client, 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 8c9209a31..357faec3f 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,6 +63,15 @@ def sync_detailed( multipart_data: List[File], keep_alive: Union[Unset, bool] = UNSET, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Upload multiple files + + Upload several files in the same request + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, multipart_data=multipart_data, @@ -83,8 +92,16 @@ def sync( multipart_data: List[File], keep_alive: Union[Unset, bool] = UNSET, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload several files in the same request""" + """ + Upload multiple files + Upload several files in the same request + + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return sync_detailed( client=client, multipart_data=multipart_data, @@ -98,6 +115,17 @@ async def asyncio_detailed( multipart_data: List[File], keep_alive: Union[Unset, bool] = UNSET, ) -> Response[Union[Any, HTTPValidationError]]: + """ + Upload multiple files + + Upload several files in the same request + + Args: + keep_alive (Union[Unset, bool]): None, + + Returns: + Response[Union[Any, HTTPValidationError]] + """ kwargs = _get_kwargs( client=client, multipart_data=multipart_data, @@ -116,8 +144,17 @@ async def asyncio( multipart_data: List[File], keep_alive: Union[Unset, bool] = UNSET, ) -> Optional[Union[Any, HTTPValidationError]]: - """Upload several files in the same request""" + """ + Upload multiple files + + Upload several files in the same request + + Args: + keep_alive (Union[Unset, bool]): None, + Returns: + Optional[Union[Any, HTTPValidationError]] + """ return ( await asyncio_detailed( client=client, 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 87f924558..5f1eece71 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 @@ -44,6 +44,13 @@ def sync_detailed( client: Client, import_: str, ) -> Response[Any]: + """ + + Args: + import_ (str): None: + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, import_=import_, @@ -62,6 +69,15 @@ async def asyncio_detailed( client: Client, import_: str, ) -> Response[Any]: + """ + + + Args: + import_ (str): None: + + Returns: + Response[Any] + """ kwargs = _get_kwargs( client=client, import_=import_, 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 f5c34f5be..17ff2ec74 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,14 @@ @attr.s(auto_attribs=True) class AFormData: - """ """ + """ + + + Properties: + an_required_field (str): None + an_optional_field (Union[Unset, str]): None + + """ an_required_field: str an_optional_field: Union[Unset, str] = UNSET 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 a7a68874a..0161116b5 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 @@ -16,7 +16,40 @@ @attr.s(auto_attribs=True) class AModel: - """A Model for testing all the ways custom objects can be used""" + """ + A Model for testing all the ways custom objects can be used + + Properties: + an_enum_value (AnEnum): For testing Enums in all the ways they can be + used + an_allof_enum_with_overridden_default (AnAllOfEnum): None|default: + AnAllOfEnum.OVERRIDDEN_DEFAULT + a_camel_date_time (Union[datetime.date, datetime.datetime]): None + a_date (datetime.date): None + required_not_nullable (str): None + one_of_models (Union[Any, FreeFormModel, ModelWithUnionProperty]): None + model (ModelWithUnionProperty): + any_value (Union[Unset, Any]): None + an_optional_allof_enum (Union[Unset, AnAllOfEnum]): None + nested_list_of_enums (Union[Unset, List[List[DifferentEnum]]]): None + a_nullable_date (Optional[datetime.date]): None + a_not_required_date (Union[Unset, datetime.date]): None + attr_1_leading_digit (Union[Unset, str]): None + required_nullable (Optional[str]): None + not_required_nullable (Union[Unset, None, str]): None + not_required_not_nullable (Union[Unset, str]): None + nullable_one_of_models (Union[FreeFormModel, ModelWithUnionProperty, + None]): None + not_required_one_of_models (Union[FreeFormModel, ModelWithUnionProperty, + Unset]): None + not_required_nullable_one_of_models (Union[FreeFormModel, + ModelWithUnionProperty, None, Unset, str]): None + nullable_model (Optional[ModelWithUnionProperty]): + not_required_model (Union[Unset, ModelWithUnionProperty]): + not_required_nullable_model (Union[Unset, None, + ModelWithUnionProperty]): + + """ an_enum_value: AnEnum a_camel_date_time: Union[datetime.date, datetime.datetime] 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 c71bf8dcf..423d420af 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,43 @@ @attr.s(auto_attribs=True) class AModelWithPropertiesReferenceThatAreNotObject: - """ """ + """ + + + Properties: + enum_properties_ref (List[AnEnum]): None + str_properties_ref (List[str]): None + date_properties_ref (List[datetime.date]): None + datetime_properties_ref (List[datetime.datetime]): None + int32_properties_ref (List[int]): None + int64_properties_ref (List[int]): None + float_properties_ref (List[float]): None + double_properties_ref (List[float]): None + file_properties_ref (List[File]): None + bytestream_properties_ref (List[str]): None + enum_properties (List[AnEnum]): None + str_properties (List[str]): None + date_properties (List[datetime.date]): None + datetime_properties (List[datetime.datetime]): None + int32_properties (List[int]): None + int64_properties (List[int]): None + float_properties (List[float]): None + double_properties (List[float]): None + file_properties (List[File]): None + bytestream_properties (List[str]): None + enum_property_ref (AnEnum): For testing Enums in all the ways they can + be used + str_property_ref (str): None + date_property_ref (datetime.date): None + datetime_property_ref (datetime.datetime): None + int32_property_ref (int): None + int64_property_ref (int): None + float_property_ref (float): None + double_property_ref (float): None + file_property_ref (File): None + bytestream_property_ref (str): None + + """ 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_sub_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/all_of_sub_model.py index 515374d19..d95154275 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,15 @@ @attr.s(auto_attribs=True) class AllOfSubModel: - """ """ + """ + + + Properties: + a_sub_property (Union[Unset, str]): None + type (Union[Unset, str]): None + type_enum (Union[Unset, AllOfSubModelTypeEnum]): None + + """ a_sub_property: Union[Unset, str] = UNSET type: Union[Unset, str] = UNSET 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 5fabb03e4..4b3642bb9 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,15 @@ @attr.s(auto_attribs=True) class AnotherAllOfSubModel: - """ """ + """ + + + Properties: + another_sub_property (Union[Unset, str]): None + type (Union[Unset, AnotherAllOfSubModelType]): None + type_enum (Union[Unset, AnotherAllOfSubModelTypeEnum]): None + + """ another_sub_property: Union[Unset, str] = UNSET type: Union[Unset, AnotherAllOfSubModelType] = UNSET 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 683025d4e..585496f23 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 @@ -22,7 +22,23 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPost: - """ """ + """ + + + Properties: + some_file (File): None + some_object (BodyUploadFileTestsUploadPostSomeObject): + some_optional_file (Union[Unset, File]): None + some_string (Union[Unset, str]): None|default: 'some_default_string' + some_number (Union[Unset, float]): None + some_array (Union[Unset, List[float]]): None + some_optional_object (Union[Unset, + BodyUploadFileTestsUploadPostSomeOptionalObject]): + some_nullable_object + (Optional[BodyUploadFileTestsUploadPostSomeNullableObject]): + some_enum (Union[Unset, DifferentEnum]): An enumeration. + + """ 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 b2ce8457e..b9f0f5e6b 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,13 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostAdditionalProperty: - """ """ + """ + + + Properties: + foo (Union[Unset, str]): None + + """ foo: Union[Unset, str] = UNSET 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/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 f97e865aa..e882c1d3c 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,13 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeNullableObject: - """ """ + """ + + + Properties: + bar (Union[Unset, str]): None + + """ bar: Union[Unset, str] = UNSET 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/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 85eaba04e..e12cdf246 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,14 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeObject: - """ """ + """ + + + Properties: + num (float): None + text (str): None + + """ 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 f983f83f4..01800cff5 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,13 @@ @attr.s(auto_attribs=True) class BodyUploadFileTestsUploadPostSomeOptionalObject: - """ """ + """ + + + Properties: + foo (str): None + + """ foo: str 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/free_form_model.py b/end_to_end_tests/golden-record/my_test_api_client/models/free_form_model.py index f8cc2151c..49de8ca6e 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,12 @@ @attr.s(auto_attribs=True) class FreeFormModel: - """ """ + """ + + + Properties: + + """ 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 e777fcc87..976cfb90f 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 @@ -10,7 +10,13 @@ @attr.s(auto_attribs=True) class HTTPValidationError: - """ """ + """ + + + Properties: + detail (Union[Unset, List[ValidationError]]): None + + """ detail: Union[Unset, List[ValidationError]] = UNSET 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..cd6efcc93 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,12 @@ @attr.s(auto_attribs=True) class Import: - """ """ + """ + + + Properties: + + """ 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 415f27486..2b7d082bb 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,16 @@ @attr.s(auto_attribs=True) class ModelFromAllOf: - """ """ + """ + + + Properties: + a_sub_property (Union[Unset, str]): None + type (Union[Unset, AnotherAllOfSubModelType]): None + type_enum (Union[Unset, AnotherAllOfSubModelTypeEnum]): None + another_sub_property (Union[Unset, str]): None + + """ a_sub_property: Union[Unset, str] = UNSET type: Union[Unset, AnotherAllOfSubModelType] = UNSET 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..3b34c15d1 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,12 @@ @attr.s(auto_attribs=True) class ModelName: - """ """ + """ + + + Properties: + + """ 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 a2e168758..3d028ce80 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 @@ -12,7 +12,13 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlined: - """ """ + """ + + + Properties: + a_number (Union[Unset, float]): None + + """ a_number: Union[Unset, float] = UNSET additional_properties: Dict[str, ModelWithAdditionalPropertiesInlinedAdditionalProperty] = attr.ib( 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 490f6e34c..1fe76fae9 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,13 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesInlinedAdditionalProperty: - """ """ + """ + + + Properties: + extra_props_prop (Union[Unset, str]): None + + """ extra_props_prop: Union[Unset, str] = UNSET 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_refed.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_additional_properties_refed.py index d51c5d72c..6b6a3d8a8 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,12 @@ @attr.s(auto_attribs=True) class ModelWithAdditionalPropertiesRefed: - """ """ + """ + + + Properties: + + """ 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 08a016dd8..fe2ceabd0 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 @@ -11,7 +11,12 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonProperties: - """ """ + """ + + + Properties: + + """ additional_properties: Dict[ str, Union[List[str], ModelWithAnyJsonPropertiesAdditionalPropertyType0, 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..bcb227b5e 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,12 @@ @attr.s(auto_attribs=True) class ModelWithAnyJsonPropertiesAdditionalPropertyType0: - """ """ + """ + + + Properties: + + """ 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_primitive_additional_properties.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_primitive_additional_properties.py index ee28313bd..1b151ca23 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 @@ -12,7 +12,14 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalProperties: - """ """ + """ + + + Properties: + a_date_holder (Union[Unset, + ModelWithPrimitiveAdditionalPropertiesADateHolder]): + + """ a_date_holder: Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder] = UNSET 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_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..74397fe2c 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,12 @@ @attr.s(auto_attribs=True) class ModelWithPrimitiveAdditionalPropertiesADateHolder: - """ """ + """ + + + Properties: + + """ 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 e28a14e91..36fab63ef 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 @@ -10,7 +10,13 @@ @attr.s(auto_attribs=True) class ModelWithPropertyRef: - """ """ + """ + + + Properties: + inner (Union[Unset, ModelName]): + + """ inner: Union[Unset, ModelName] = UNSET 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_union_property.py b/end_to_end_tests/golden-record/my_test_api_client/models/model_with_union_property.py index b7fa116e3..a15a4c5d3 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,13 @@ @attr.s(auto_attribs=True) class ModelWithUnionProperty: - """ """ + """ + + + Properties: + a_property (Union[AnEnum, AnIntEnum, Unset]): None + + """ a_property: Union[AnEnum, AnIntEnum, Unset] = 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 27e91a80a..c9512e3fe 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 @@ -11,7 +11,14 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlined: - """ """ + """ + + + Properties: + fruit (Union[ModelWithUnionPropertyInlinedFruitType0, + ModelWithUnionPropertyInlinedFruitType1, Unset]): None + + """ fruit: Union[ModelWithUnionPropertyInlinedFruitType0, ModelWithUnionPropertyInlinedFruitType1, Unset] = 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 333d822c7..eec99c8f9 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,13 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType0: - """ """ + """ + + + Properties: + apples (Union[Unset, str]): None + + """ apples: Union[Unset, str] = UNSET 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_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 d2020747c..2d9e5c8a0 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,13 @@ @attr.s(auto_attribs=True) class ModelWithUnionPropertyInlinedFruitType1: - """ """ + """ + + + Properties: + bananas (Union[Unset, str]): None + + """ bananas: Union[Unset, str] = UNSET 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/none.py b/end_to_end_tests/golden-record/my_test_api_client/models/none.py index e1722f094..77ad48334 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,12 @@ @attr.s(auto_attribs=True) class None_: - """ """ + """ + + + Properties: + + """ 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 e74ed557b..a831b558e 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,13 @@ @attr.s(auto_attribs=True) class TestInlineObjectsJsonBody: - """ """ + """ + + + Properties: + a_property (Union[Unset, str]): None + + """ a_property: Union[Unset, str] = UNSET 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 7c6aa6fb2..535fcaa72 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,13 @@ @attr.s(auto_attribs=True) class TestInlineObjectsResponse200: - """ """ + """ + + + Properties: + a_property (Union[Unset, str]): None + + """ a_property: Union[Unset, str] = UNSET 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 8bbb20c76..e80e9790a 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,15 @@ @attr.s(auto_attribs=True) class ValidationError: - """ """ + """ + + + Properties: + loc (List[str]): None + msg (str): None + type (str): None + + """ loc: List[str] msg: str diff --git a/openapi_python_client/parser/properties/__init__.py b/openapi_python_client/parser/properties/__init__.py index 98707cfa3..17660b65f 100644 --- a/openapi_python_client/parser/properties/__init__.py +++ b/openapi_python_client/parser/properties/__init__.py @@ -271,6 +271,8 @@ def _string_based_property( default=convert("datetime.datetime", data.default), nullable=data.nullable, python_name=python_name, + description=data.description, + example=data.example, ) if string_format == "date": return DateProperty( @@ -279,6 +281,8 @@ def _string_based_property( default=convert("datetime.date", data.default), nullable=data.nullable, python_name=python_name, + description=data.description, + example=data.example, ) if string_format == "binary": return FileProperty( @@ -287,6 +291,8 @@ def _string_based_property( default=None, nullable=data.nullable, python_name=python_name, + description=data.description, + example=data.example, ) return StringProperty( name=name, @@ -295,6 +301,8 @@ def _string_based_property( pattern=data.pattern, nullable=data.nullable, python_name=python_name, + description=data.description, + example=data.example, ) @@ -374,6 +382,8 @@ def build_enum_property( value_type=value_type, default=None, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ) default = get_enum_default(prop, data) @@ -451,6 +461,8 @@ def build_union_property( inner_properties=sub_properties, nullable=data.nullable, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) @@ -490,6 +502,8 @@ def build_list_property( inner_property=inner_prop, nullable=data.nullable, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) @@ -573,6 +587,8 @@ def _property_from_data( required=required, nullable=data.nullable, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) @@ -584,6 +600,8 @@ def _property_from_data( required=required, nullable=data.nullable, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) @@ -595,6 +613,8 @@ def _property_from_data( default=convert("bool", data.default), nullable=data.nullable, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) @@ -613,6 +633,8 @@ def _property_from_data( nullable=False, default=None, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + description=data.description, + example=data.example, ), schemas, ) diff --git a/openapi_python_client/parser/properties/model_property.py b/openapi_python_client/parser/properties/model_property.py index 0cfb7a902..cfaea08b0 100644 --- a/openapi_python_client/parser/properties/model_property.py +++ b/openapi_python_client/parser/properties/model_property.py @@ -256,6 +256,7 @@ def build_model_property( name=name, additional_properties=additional_properties, python_name=utils.PythonIdentifier(value=name, prefix=config.field_prefix), + example=data.example, ) if class_info.name in schemas.classes_by_name: error = PropertyError(data=data, detail=f'Attempted to generate duplicate models with name "{class_info.name}"') diff --git a/openapi_python_client/parser/properties/property.py b/openapi_python_client/parser/properties/property.py index af1135bf6..9b72aaab6 100644 --- a/openapi_python_client/parser/properties/property.py +++ b/openapi_python_client/parser/properties/property.py @@ -30,6 +30,8 @@ class Property: _json_type_string: ClassVar[str] = "" # Type of the property after JSON serialization default: Optional[str] = attr.ib() python_name: PythonIdentifier + description: Optional[str] = attr.ib() + example: Optional[str] = attr.ib() template: ClassVar[Optional[str]] = None json_is_dict: ClassVar[bool] = False @@ -107,3 +109,12 @@ def to_string(self) -> str: if default is not None: return f"{self.python_name}: {self.get_type_string()} = {default}" return f"{self.python_name}: {self.get_type_string()}" + + def to_docstring(self) -> str: + """Returns property docstring""" + doc = f"{self.python_name} ({self.get_type_string()}): {self.description}" + if self.default: + doc += f"|default: {self.default}" + if self.example: + doc += f"|ex: {self.example}" + return doc diff --git a/openapi_python_client/parser/responses.py b/openapi_python_client/parser/responses.py index 98300640d..d5bf1a3db 100644 --- a/openapi_python_client/parser/responses.py +++ b/openapi_python_client/parser/responses.py @@ -38,6 +38,8 @@ def empty_response(*, status_code: int, response_name: str, config: Config) -> R nullable=False, required=True, python_name=PythonIdentifier(value=response_name, prefix=config.field_prefix), + description="", + example="", ), source="None", ) diff --git a/openapi_python_client/templates/endpoint_module.py.jinja b/openapi_python_client/templates/endpoint_module.py.jinja index 5ddd2591b..e2e2b1265 100644 --- a/openapi_python_client/templates/endpoint_module.py.jinja +++ b/openapi_python_client/templates/endpoint_module.py.jinja @@ -87,6 +87,28 @@ def _build_response(*, response: httpx.Response) -> Response[{{ return_string }} def sync_detailed( {{ arguments(endpoint) | indent(4) }} ) -> Response[{{ return_string }}]: + """ + {% if endpoint.summary %}{{ endpoint.summary | wordwrap(76)}} + + {{ endpoint.description | wordwrap(76)}} + {% else %} + {{ endpoint.description | wordwrap(76)}} + {% endif %} + {% if endpoint.query_parameters or endpoint.header_parameters or endpoint.cookie_parameters %} + Args: + {% for parameter in endpoint.query_parameters.values() %} + {{ parameter.to_docstring() }}: + {% endfor %} + {% for parameter in endpoint.header_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% for parameter in endpoint.cookie_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% endif %} + Returns: + Response[{{ return_string }}] + """ kwargs = _get_kwargs( {{ kwargs(endpoint) }} ) @@ -102,8 +124,29 @@ def sync_detailed( def sync( {{ arguments(endpoint) | indent(4) }} ) -> Optional[{{ return_string }}]: - """ {{ endpoint.description }} """ - + """ + {% if endpoint.summary %}{{ endpoint.summary | wordwrap(76)}} + + {{ endpoint.description | wordwrap(76)}} + {% else %} + {{ endpoint.description | wordwrap(76)}} + {% endif %} + + {% if endpoint.query_parameters or endpoint.header_parameters or endpoint.cookie_parameters %} + Args: + {% for parameter in endpoint.query_parameters.values() %} + {{ parameter.to_docstring() }}: + {% endfor %} + {% for parameter in endpoint.header_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% for parameter in endpoint.cookie_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% endif %} + Returns: + Optional[{{ return_string }}] + """ return sync_detailed( {{ kwargs(endpoint) }} ).parsed @@ -112,6 +155,30 @@ def sync( async def asyncio_detailed( {{ arguments(endpoint) | indent(4) }} ) -> Response[{{ return_string }}]: + """ + {% if endpoint.summary %}{{ endpoint.summary | wordwrap(76)}} + + {{ endpoint.description | wordwrap(76)}} + {% else %} + {{ endpoint.description | wordwrap(76)}} + {% endif %} + + {% if endpoint.query_parameters or endpoint.header_parameters or endpoint.cookie_parameters %} + Args: + {% for parameter in endpoint.query_parameters.values() %} + {{ parameter.to_docstring() }}: + {% endfor %} + {% for parameter in endpoint.header_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% for parameter in endpoint.cookie_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% endif %} + + Returns: + Response[{{ return_string }}] + """ kwargs = _get_kwargs( {{ kwargs(endpoint) }} ) @@ -127,9 +194,31 @@ async def asyncio_detailed( async def asyncio( {{ arguments(endpoint) | indent(4) }} ) -> Optional[{{ return_string }}]: - """ {{ endpoint.description }} """ - + """ + {% if endpoint.summary %}{{ endpoint.summary | wordwrap(76)}} + + {{ endpoint.description | wordwrap(76)}} + {% else %} + {{ endpoint.description | wordwrap(76)}} + {% endif %} + + {% if endpoint.query_parameters or endpoint.header_parameters or endpoint.cookie_parameters %} + Args: + {% for parameter in endpoint.query_parameters.values() %} + {{ parameter.to_docstring() }}: + {% endfor %} + {% for parameter in endpoint.header_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% for parameter in endpoint.cookie_parameters.values() %} + {{ parameter.to_docstring() }}, + {% endfor %} + {% endif %} + Returns: + Optional[{{ return_string }}] + """ return (await asyncio_detailed( {{ kwargs(endpoint) }} )).parsed {% endif %} + diff --git a/openapi_python_client/templates/model.py.jinja b/openapi_python_client/templates/model.py.jinja index c4c23c878..cef54bd4f 100644 --- a/openapi_python_client/templates/model.py.jinja +++ b/openapi_python_client/templates/model.py.jinja @@ -28,7 +28,17 @@ T = TypeVar("T", bound="{{ class_name }}") @attr.s(auto_attribs=True) class {{ class_name }}: - """ {{ model.description }} """ + """ + {% if model.title %}{{ model.title | wordwrap(76) }}{% endif %} + {% if model.description %}{{ model.description | wordwrap(76) }}{% endif %} + + {% if model.example %}Example:{{ model.example | string | wordwrap(76) }}{% endif %} + + Properties: + {% for property in model.required_properties + model.optional_properties %} + {{ property.to_docstring() | wordwrap(72) }} + {% endfor %} + """ {% for property in model.required_properties + model.optional_properties %} {% if property.default is none and property.required %} {{ property.to_string() }} diff --git a/tests/conftest.py b/tests/conftest.py index dfa885c23..2c99a531c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -36,6 +36,8 @@ def _factory(**kwargs): "relative_imports": set(), "additional_properties": False, "python_name": "", + "description": "", + "example": "", **kwargs, } return ModelProperty(**kwargs) @@ -210,6 +212,8 @@ def _common_kwargs(kwargs: Dict[str, Any]) -> Dict[str, Any]: "required": True, "nullable": False, "default": None, + "description": "", + "example": "", **kwargs, } if not kwargs.get("python_name"): diff --git a/tests/test_parser/test_properties/test_model_property.py b/tests/test_parser/test_properties/test_model_property.py index 6e1d98166..7d66e7ddc 100644 --- a/tests/test_parser/test_properties/test_model_property.py +++ b/tests/test_parser/test_properties/test_model_property.py @@ -61,6 +61,8 @@ class TestBuildModelProperty: nullable=False, default=None, python_name="additional_property", + description="", + example="", ), ), ], diff --git a/tests/test_parser/test_responses.py b/tests/test_parser/test_responses.py index 8c35cea1f..547e2f7a3 100644 --- a/tests/test_parser/test_responses.py +++ b/tests/test_parser/test_responses.py @@ -20,7 +20,15 @@ def test_response_from_data_no_content(): assert response == Response( status_code=200, - prop=AnyProperty(name="response_200", default=None, nullable=False, required=True, python_name="response_200"), + prop=AnyProperty( + name="response_200", + default=None, + nullable=False, + required=True, + python_name="response_200", + description="", + example="", + ), source="None", ) @@ -46,7 +54,15 @@ def test_response_from_data_no_content_schema(): assert response == Response( status_code=200, - prop=AnyProperty(name="response_200", default=None, nullable=False, required=True, python_name="response_200"), + prop=AnyProperty( + name="response_200", + default=None, + nullable=False, + required=True, + python_name="response_200", + description=data.description, + example=data.example, + ), source="None", ) diff --git a/tests/test_templates/test_property_templates/test_date_property/test_date_property.py b/tests/test_templates/test_property_templates/test_date_property/test_date_property.py index 02137add4..f5d4aa798 100644 --- a/tests/test_templates/test_property_templates/test_date_property/test_date_property.py +++ b/tests/test_templates/test_property_templates/test_date_property/test_date_property.py @@ -12,6 +12,8 @@ def date_property(required=True, nullable=True, default=None) -> DateProperty: nullable=nullable, default=default, python_name="a_prop", + description="", + example="", )