You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Endpoints with both optional and not optional parameters can produce broken python modules because there is no guarantee that the optional arguments will be last in the generated function signature.
The problem lies in the implementation of the jinja macro arguments and in the _add_parameters function of Endpoint. A quick fix is to add:
# Optional parameters must be lastforparametersin [endpoint.path_parameters, endpoint.query_parameters, endpoint.header_parameters]:
parameters.sort(key=lambdae: e.nullableornote.required)
At the end of Endpoint.__add_parameters.
What should I do for a clean fix? I guess we need to regroup the three list mentioned above in a single one? Any pitfalls?
0.7.0 has a complete rework of how nullable & optional properties are handled, and this should definitely be fixed in there (I remember running into this). Give that a shot and let me know if you still have troubles!
Describe the bug
Endpoints with both optional and not optional parameters can produce broken python modules because there is no guarantee that the optional arguments will be last in the generated function signature.
The problem lies in the implementation of the jinja macro
arguments
and in the_add_parameters
function ofEndpoint
. A quick fix is to add:At the end of
Endpoint.__add_parameters
.What should I do for a clean fix? I guess we need to regroup the three list mentioned above in a single one? Any pitfalls?
OpenAPI Spec File
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: