Skip to content

Remove trailing comma in endpoint_macros.pyi #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions end_to_end_tests/golden-master/my_test_api_client/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

def get_user_list(
*, client: Client, an_enum_value: List[AnEnum], some_date: Union[datetime.date, datetime.datetime],
) -> Union[
List[AModel], HTTPValidationError,
]:
) -> Union[List[AModel], HTTPValidationError]:

""" Get a list of things """
url = "{}/tests/".format(client.base_url)
Expand Down Expand Up @@ -112,9 +110,7 @@ def get_basic_list_of_booleans(*, client: Client,) -> List[bool]:

def upload_file_tests_upload_post(
*, client: Client, multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Optional[bool] = None,
) -> Union[
None, HTTPValidationError,
]:
) -> Union[None, HTTPValidationError]:

""" Upload a file """
url = "{}/tests/upload".format(client.base_url)
Expand All @@ -133,11 +129,7 @@ def upload_file_tests_upload_post(
raise ApiResponseError(response=response)


def json_body_tests_json_body_post(
*, client: Client, json_body: AModel,
) -> Union[
None, HTTPValidationError,
]:
def json_body_tests_json_body_post(*, client: Client, json_body: AModel,) -> Union[None, HTTPValidationError]:

""" Try sending a JSON body """
url = "{}/tests/json_body".format(client.base_url)
Expand Down Expand Up @@ -171,9 +163,7 @@ def test_defaults_tests_test_defaults_post(
),
union_prop: Optional[Union[Optional[float], Optional[str]]] = "not a float",
enum_prop: Optional[AnEnum] = None,
) -> Union[
None, HTTPValidationError,
]:
) -> Union[None, HTTPValidationError]:

""" """
url = "{}/tests/test_defaults".format(client.base_url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

async def get_user_list(
*, client: Client, an_enum_value: List[AnEnum], some_date: Union[datetime.date, datetime.datetime],
) -> Union[
List[AModel], HTTPValidationError,
]:
) -> Union[List[AModel], HTTPValidationError]:

""" Get a list of things """
url = "{}/tests/".format(client.base_url,)
Expand Down Expand Up @@ -117,9 +115,7 @@ async def get_basic_list_of_booleans(*, client: Client,) -> List[bool]:

async def upload_file_tests_upload_post(
*, client: Client, multipart_data: BodyUploadFileTestsUploadPost, keep_alive: Optional[bool] = None,
) -> Union[
None, HTTPValidationError,
]:
) -> Union[None, HTTPValidationError]:

""" Upload a file """
url = "{}/tests/upload".format(client.base_url,)
Expand All @@ -139,11 +135,7 @@ async def upload_file_tests_upload_post(
raise ApiResponseError(response=response)


async def json_body_tests_json_body_post(
*, client: Client, json_body: AModel,
) -> Union[
None, HTTPValidationError,
]:
async def json_body_tests_json_body_post(*, client: Client, json_body: AModel,) -> Union[None, HTTPValidationError]:

""" Try sending a JSON body """
url = "{}/tests/json_body".format(client.base_url,)
Expand Down Expand Up @@ -178,9 +170,7 @@ async def test_defaults_tests_test_defaults_post(
),
union_prop: Optional[Union[Optional[float], Optional[str]]] = "not a float",
enum_prop: Optional[AnEnum] = None,
) -> Union[
None, HTTPValidationError,
]:
) -> Union[None, HTTPValidationError]:

""" """
url = "{}/tests/test_defaults".format(client.base_url,)
Expand Down
2 changes: 1 addition & 1 deletion openapi_python_client/templates/endpoint_macros.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if {{ property.python_name }} is not None:
{% else %}
) -> Union[
{% for response in endpoint.responses %}
{{ response.return_string() }},
{{ response.return_string() }}{{ "," if not loop.last }}
{% endfor %}
]:
{% endif %}
Expand Down