We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
codegenProperty retrieves wrong property if one is required and another is optional
openapi: 3.0.3 info: title: openapi 3.0.3 sample spec description: sample spec for testing openapi functionality, built from json schema tests for draft6 version: 0.0.1 paths: {} components: schemas: FooRequired: properties: foo: {} required: - foo FooOptional: properties: foo: {}
Any generator
Generate code and see that the required property is not correct in
This is happening because we store the required status (defined at a schema level higher) in the codegenProperty instance.
This came up when working on #12826 Where the property foo is optional in one place and required in another
Add the required boolean into fromProperty creation signature and cache call.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
codegenProperty retrieves wrong property if one is required and another is optional
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Any generator
Steps to reproduce
Generate code and see that
the required property is not correct in
This is happening because we store the required status (defined at a schema level higher) in the codegenProperty instance.
Related issues/PRs
This came up when working on
#12826
Where the property foo is optional in one place and required in another
Suggest a fix
Add the required boolean into fromProperty creation signature and cache call.
The text was updated successfully, but these errors were encountered: