-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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] adding a requirement on a sibling field in an allOf throws AttributeError on import #13676
Comments
Thanks for reporting this |
Draft fix is being worked in openapi-json-schema-tools/openapi-json-schema-generator#44 |
This was fixed in the separate repo in openapi-json-schema-tools/openapi-json-schema-generator#44. You can use it from the latest release there if you want. Here, I will update the python generator in this repo to include this fix before the 6.2.1 release. |
What is the relation between this project and |
@tnielens please refer to #13501 (comment) for more information. |
@vincent-raman is there a regression with my fix? |
No, that was a mistake, I removed my comment, sorry. It seems working pretty well |
Bug Report Checklist
Description
Adding a requirement on a sibling field in an allOf breaks the model import
openapi-generator version
6.2.0
OpenAPI declaration file content or url
Generation Details
openapi-generator-cli generate -g python -i test.yaml -o out
Steps to reproduce
Generate the client then try to import the generated "TestRequired" class. It will fail with an Error
AttributeError: type object 'properties' has no attribute 'test'
The generated class is the following
the constructor of
all_of_1
expects a requiredtest
argument whose typing is based onproperties
which doesn't contain it.Suggest a fix
Add typing for required parameters not existing in properties as
AnyTypeSchema
The text was updated successfully, but these errors were encountered: