-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [PYTHON CLIENT] response is None although data is returned HTTP 2xx #12189
Comments
Can you please try python-experimental? It has better deserialization support than python. |
I have tried with 5.4,0 and 6.0.0 Beta using: java -jar openapi-generator-cli.jar generate -i "openapi3.yaml" -g python-experimental -o openapi-python-client --package-name rest_client --additional-properties packageVersion=0.1,packageName=rest_client,modelPropertyNaming=original But now it is even worse and has syntax issues: Error : "Union requires two or more type argumentsPylance"
What I also mentioned is that if you have a HTTP Response 200 with a required field set and you get a HTTP Response 202 with a different return structure it throws an error that it cannot find the required property from the 200 response in the 202 response. Is this also a known bug? I also tried to get rid off the snake_case conversion with the "modelPropertyNaming=original" but this also does not work. |
1I don't think that those releases contain the fix that you need. Please pull down and build the latest master branch.
Using a commit which includes that PR will fix that SyntaxError 2
Your explanation here is confusing.
Not sure what the bug is that you are mentioning. 3Where are you seeing property naming that does not conform to the spec?
The openapi spec allows component schema names that are invalid python class names like:
but one would also need to fix the class file names and imports too which is non trivial. |
Closing this issue because it is handled in the |
Running openapi cli generator for python results in 'response_type': None for POST although multiple are defined.
The Route can return the following status codes 200, 202, 401, 403 or 500.
The issue is if the route is called via the python client it returns "None" for the 202 status code instead of the actual returned value of "{id:123}".
Is there away to let the client handle also such 2xx responses to return the data?
Via other REST Tools it displays the correct response values as application/json as it should be.
Sample definitions:
The text was updated successfully, but these errors were encountered: