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
The normalization setting SIMPLIFY_ONEOF_ANYOF misses to simplify oneOf schemas that has one single non-null subSchema.
SIMPLIFY_ONEOF_ANYOF
This seems to be due to a misconfiguration where the SubSchemas.lengh == 1 is only checked if there was at least one nullable subSchema.
SubSchemas.lengh == 1
Even if there are no nullable subSchemas we should still check if the schema can be simplified when there is only a single subSchema.
7,12
ParentWithOneOfProperty: type: object properties: number: oneOf: - $ref: '#/components/schemas/Number'
Introduce an additional test case to this test that verifies that ParentWithOneOfProperty is properly simplified to:
ParentWithOneOfProperty
ParentWithOneOfProperty: type: object properties: number: - $ref: '#/components/schemas/Number'
The test will failed since the schema isn't simplified.
I will create a PR for a suggested fix
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
The normalization setting
SIMPLIFY_ONEOF_ANYOF
misses to simplify oneOf schemas that has one single non-null subSchema.This seems to be due to a misconfiguration where the
SubSchemas.lengh == 1
is only checked if there was at least one nullable subSchema.Even if there are no nullable subSchemas we should still check if the schema can be simplified when there is only a single subSchema.
openapi-generator version
7,12
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Introduce an additional test case to this test that verifies that
ParentWithOneOfProperty
is properly simplified to:The test will failed since the schema isn't simplified.
Related issues/PRs
Suggest a fix
I will create a PR for a suggested fix
The text was updated successfully, but these errors were encountered: