File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
openapi_python_client/templates Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -19,27 +19,29 @@ def {{ endpoint.name }}(
1919 {% else % }
2020 client : Client ,
2121 {% endif % }
22+ {# path parameters #}
23+ {% for parameter in endpoint .path_parameters % }
24+ {{ parameter .to_string () }},
25+ {% endfor % }
2226 {# Form data if any #}
2327 {% if endpoint .form_body_reference % }
2428 form_data : {{ endpoint .form_body_reference .class_name }},
2529 {% endif % }
26- {# Form data if any #}
30+ {# JSON body if any #}
2731 {% if endpoint .json_body % }
2832 json_body : {{ endpoint .json_body .get_type_string () }},
2933 {% endif % }
3034 {# query parameters #}
31- {% if endpoint .query_parameters % }
3235 {% for parameter in endpoint .query_parameters % }
3336 {{ parameter .to_string () }},
3437 {% endfor % }
35- {% endif % }
3638) -> Union [
3739 {% for response in endpoint .responses % }
3840 {{ response .return_string () }},
3941 {% endfor % }
4042]:
4143 """ {{ endpoint.description }} """
42- url = client .base_url + " {{ endpoint.path }}"
44+ url = f" { client .base_url } {{ endpoint.path }}"
4345
4446 {% if endpoint .query_parameters % }
4547 params = {
Original file line number Diff line number Diff line change 11from enum import Enum
22
3- class {{ enum .reference .class_name }}(Enum ):
3+ class {{ enum .reference .class_name }}(str , Enum ):
44 {% for key , value in enum .values .items () % }
55 {{ key }} = "{{ value }}"
66 {% endfor % }
You can’t perform that action at this time.
0 commit comments