File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -277,9 +277,16 @@ def _build_api(self) -> None:
277
277
278
278
for endpoint in collection .endpoints :
279
279
module_path = tag_dir / f"{ utils .PythonIdentifier (endpoint .name , self .config .field_prefix )} .py"
280
+ endpoint_path_python_names = endpoint .path
281
+ for parameter in endpoint .path_parameters :
282
+ endpoint_path_python_names = endpoint_path_python_names .replace (
283
+ f'{{{ parameter .name } }}' ,
284
+ f'{{{ parameter .python_name } }}'
285
+ )
280
286
module_path .write_text (
281
287
endpoint_template .render (
282
288
endpoint = endpoint ,
289
+ endpoint_path_python_names = endpoint_path_python_names ,
283
290
),
284
291
encoding = self .config .file_encoding ,
285
292
)
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ def _get_kwargs(
29
29
_kwargs: Dict[str, Any] = {
30
30
"method": "{{ endpoint.method }}",
31
31
{% if endpoint .path_parameters %}
32
- "url": "{{ endpoint.path }}".format(
32
+ "url": "{{ endpoint_path_python_names }}".format(
33
33
{% - for parameter in endpoint .path_parameters -%}
34
- {{parameter.name }}={{parameter.python_name}},
34
+ {{parameter.python_name }}={{parameter.python_name}},
35
35
{% - endfor -%}
36
36
),
37
37
{% else %}
You can’t perform that action at this time.
0 commit comments