File tree 5 files changed +44
-3
lines changed
end_to_end_tests/golden-record/my_test_api_client/api/tests
5 files changed +44
-3
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ def sync_detailed(
59
59
60
60
Try sending a JSON body
61
61
62
+ Args:
63
+ json_body (AModel): A Model for testing all the ways custom objects can be used
64
+
62
65
Returns:
63
66
Response[Union[Any, HTTPValidationError]]
64
67
"""
@@ -85,6 +88,9 @@ def sync(
85
88
86
89
Try sending a JSON body
87
90
91
+ Args:
92
+ json_body (AModel): A Model for testing all the ways custom objects can be used
93
+
88
94
Returns:
89
95
Response[Union[Any, HTTPValidationError]]
90
96
"""
@@ -104,6 +110,9 @@ async def asyncio_detailed(
104
110
105
111
Try sending a JSON body
106
112
113
+ Args:
114
+ json_body (AModel): A Model for testing all the ways custom objects can be used
115
+
107
116
Returns:
108
117
Response[Union[Any, HTTPValidationError]]
109
118
"""
@@ -128,6 +137,9 @@ async def asyncio(
128
137
129
138
Try sending a JSON body
130
139
140
+ Args:
141
+ json_body (AModel): A Model for testing all the ways custom objects can be used
142
+
131
143
Returns:
132
144
Response[Union[Any, HTTPValidationError]]
133
145
"""
Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ def sync_detailed(
55
55
) -> Response [Union [HTTPValidationError , str ]]:
56
56
"""Json Body Which is String
57
57
58
+ Args:
59
+ json_body (str):
60
+
58
61
Returns:
59
62
Response[Union[HTTPValidationError, str]]
60
63
"""
@@ -79,6 +82,9 @@ def sync(
79
82
) -> Optional [Union [HTTPValidationError , str ]]:
80
83
"""Json Body Which is String
81
84
85
+ Args:
86
+ json_body (str):
87
+
82
88
Returns:
83
89
Response[Union[HTTPValidationError, str]]
84
90
"""
@@ -96,6 +102,9 @@ async def asyncio_detailed(
96
102
) -> Response [Union [HTTPValidationError , str ]]:
97
103
"""Json Body Which is String
98
104
105
+ Args:
106
+ json_body (str):
107
+
99
108
Returns:
100
109
Response[Union[HTTPValidationError, str]]
101
110
"""
@@ -118,6 +127,9 @@ async def asyncio(
118
127
) -> Optional [Union [HTTPValidationError , str ]]:
119
128
"""Json Body Which is String
120
129
130
+ Args:
131
+ json_body (str):
132
+
121
133
Returns:
122
134
Response[Union[HTTPValidationError, str]]
123
135
"""
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ def sync_detailed(
53
53
) -> Response [TestInlineObjectsResponse200 ]:
54
54
"""Test Inline Objects
55
55
56
+ Args:
57
+ json_body (TestInlineObjectsJsonBody):
58
+
56
59
Returns:
57
60
Response[TestInlineObjectsResponse200]
58
61
"""
@@ -77,6 +80,9 @@ def sync(
77
80
) -> Optional [TestInlineObjectsResponse200 ]:
78
81
"""Test Inline Objects
79
82
83
+ Args:
84
+ json_body (TestInlineObjectsJsonBody):
85
+
80
86
Returns:
81
87
Response[TestInlineObjectsResponse200]
82
88
"""
@@ -94,6 +100,9 @@ async def asyncio_detailed(
94
100
) -> Response [TestInlineObjectsResponse200 ]:
95
101
"""Test Inline Objects
96
102
103
+ Args:
104
+ json_body (TestInlineObjectsJsonBody):
105
+
97
106
Returns:
98
107
Response[TestInlineObjectsResponse200]
99
108
"""
@@ -116,6 +125,9 @@ async def asyncio(
116
125
) -> Optional [TestInlineObjectsResponse200 ]:
117
126
"""Test Inline Objects
118
127
128
+ Args:
129
+ json_body (TestInlineObjectsJsonBody):
130
+
119
131
Returns:
120
132
Response[TestInlineObjectsResponse200]
121
133
"""
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ def response_type(self) -> str:
416
416
return self .responses [0 ].prop .get_type_string ()
417
417
return f"Union[{ ', ' .join (types )} ]"
418
418
419
- def all_parameters (self ) -> Iterator [Property ]:
419
+ def iter_all_parameters (self ) -> Iterator [Property ]:
420
420
"""Iterate through all the parameters of this endpoint"""
421
421
yield from self .path_parameters .values ()
422
422
yield from self .query_parameters .values ()
@@ -427,6 +427,10 @@ def all_parameters(self) -> Iterator[Property]:
427
427
if self .json_body :
428
428
yield self .json_body
429
429
430
+ def list_all_parameters (self ) -> List [Property ]:
431
+ """Return a List of all the parameters of this endpoint"""
432
+ return list (self .iter_all_parameters ())
433
+
430
434
431
435
@dataclass
432
436
class GeneratorData :
Original file line number Diff line number Diff line change @@ -159,9 +159,10 @@ json_body=json_body,
159
159
{# Leave extra space so that Args or Returns isn't at the top #}
160
160
161
161
{% endif %}
162
- {% if endpoint .path_parameters or endpoint .query_parameters or endpoint .header_parameters or endpoint .cookie_parameters %}
162
+ {% set all_parameters = endpoint .list_all_parameters () %}
163
+ {% if all_parameters %}
163
164
Args:
164
- {% for parameter in endpoint . all_parameters () %}
165
+ {% for parameter in all_parameters %}
165
166
{{ parameter.to_docstring() | wordwrap(90) | indent(8) }}
166
167
{% endfor %}
167
168
You can’t perform that action at this time.
0 commit comments