-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] [Python] API client cannot retrieve data for some models #2797
Labels
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
This should be resolved for the latest version of the python generator |
This was referenced Jan 1, 2024
This was referenced Mar 15, 2024
This was referenced Mar 15, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Description
I used the openapitools-codegen-cli (latest) (and swagger-codegen (2.x,3.x) to generate a python api for a swagger spec I was given by a partner. The generated api client works in most cases but I have one model for which it always returns no data.
openapi-generator version
OpenAPI declaration file content or url
-->
Command line used for generation
docker run --rm -v %CD%:/local openapitools/openapi-generator-cli:latest generate -i local/my_swagger.yaml -g python -o local/out/python-oapit-latest -c local/config.json
Steps to reproduce
Use the getAssetPose function to return the pose always yields none for position and orientation.
Using tcpdump I can verify the request and response are properly formatted.
Related issues/PRs
Maybe this one: swagger-api/swagger-codegen#6291 (comment)
Suggest a fix
The deserialize_model function in the api client gets a pose dict and checks to see if the position and quaternion attributes exist. They do not since only the "pose" attribute exists in that json. I hacked it to work by checking for the pose attribute and then setting data = data['pose'] to dereference it one level deeper before it tries to pull the attribute values. I don't know (yet) how to elegantly fix the issue.
The text was updated successfully, but these errors were encountered: