-
-
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] additionalProperties not supported #2028
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
This feature was added in #4154 |
Hi, I just wanna double check, so to use the Thanks, |
Yes, that's right |
Thanks @spacether .. is there any documentation on the difference between We are already using python code generated by The other issue that might prevent us to move to Thank you and much appreciated for your reply! |
The interfaces are very similar in python and python-experimental so switching from one to the other should be pretty straightforward.
Not at this time. I have listed out some of the significant new features below. Breaking changes are allowed to python-experimental and one can peg the openapi version that you are using to stay with one that you like.
In the near future python-experimental will become the main python generator. |
@spacether sounds like we would eventually need to move to Would you recommend production apps using |
Bug Report Checklist
Description
Generated Python clients do not have the ability to access the additional properties of models with
additionalProperties
defined. The only ones that can be accessed are those that are explicitly defined in the model and the rest are ignored. In contrast, the generated Java models extend HashMap whenadditionalProperties
are defined and they can get accessed by Map#get(String).openapi-generator version
4.0.0
OpenAPI declaration file content or url
Full specification: https://github.com/Open-MBEE/mms/blob/develop/mms-ent/repo-amp/src/main/amp/web/mms/mms.swagger.yaml
Command line used for generation
java -jar /path/to/openapi-generator-cli.jar generate -i /path/to/mms.swagger.yaml -l python -o ~/tmp
Steps to reproduce
Inspecting the generated
Element.py
file after executing the command above with the specification above. There is also a usage ofadditionalProperties
in the Petstore API that exhibits the same behavior.Related issues/PRs
Clone of issue made and fixed in
swagger-api/swagger-codegen
: swagger-api/swagger-codegen#8075Suggest a fix
I believe that the additional properties can be stored in a dict, analogously to how they are handled in Java.
The text was updated successfully, but these errors were encountered: