File tree 2 files changed +7
-5
lines changed
openapi_python_client/templates 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -19,27 +19,29 @@ def {{ endpoint.name }}(
19
19
{% else % }
20
20
client : Client ,
21
21
{% endif % }
22
+ {# path parameters #}
23
+ {% for parameter in endpoint .path_parameters % }
24
+ {{ parameter .to_string () }},
25
+ {% endfor % }
22
26
{# Form data if any #}
23
27
{% if endpoint .form_body_reference % }
24
28
form_data : {{ endpoint .form_body_reference .class_name }},
25
29
{% endif % }
26
- {# Form data if any #}
30
+ {# JSON body if any #}
27
31
{% if endpoint .json_body % }
28
32
json_body : {{ endpoint .json_body .get_type_string () }},
29
33
{% endif % }
30
34
{# query parameters #}
31
- {% if endpoint .query_parameters % }
32
35
{% for parameter in endpoint .query_parameters % }
33
36
{{ parameter .to_string () }},
34
37
{% endfor % }
35
- {% endif % }
36
38
) -> Union [
37
39
{% for response in endpoint .responses % }
38
40
{{ response .return_string () }},
39
41
{% endfor % }
40
42
]:
41
43
""" {{ endpoint.description }} """
42
- url = client .base_url + " {{ endpoint.path }}"
44
+ url = f" { client .base_url } {{ endpoint.path }}"
43
45
44
46
{% if endpoint .query_parameters % }
45
47
params = {
Original file line number Diff line number Diff line change 1
1
from enum import Enum
2
2
3
- class {{ enum .reference .class_name }}(Enum ):
3
+ class {{ enum .reference .class_name }}(str , Enum ):
4
4
{% for key , value in enum .values .items () % }
5
5
{{ key }} = "{{ value }}"
6
6
{% endfor % }
You can’t perform that action at this time.
0 commit comments