-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Description
Hello! I'm trying out the new 6.0 release and noticed it generated some invalid Python-FastAPI code. Here is the offending line of code:
openapi-generator/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache
Line 34 in 5307a8d
| {{code}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>, |
And here is the OpenAPI.yaml that was used as input:
And lastly here is the invalid python code that was generated:
responses={
200: {"model": Pet, "description": "pet response"},
200: {"model": Error, "description": "unexpected error"},
},In the openapi.yaml file there was a response model for status code 200 and a response model for "Default" (everything else). The code generator interpreted this "Default" as a 200 which resulted in a python dictionary with 2x keys for 200, which is invalid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels