Bug Report Checklist
Description
OpenAPINormalizer is discarding information from specification when using OAS 3.1 "const" to list enum values based onto oneOf.
Resetting the oneOf, means enums mist and related metadata are lost (e.g. deprecated values).
openapi-generator version
pre-V7.19.0: commit id: 23eff66
OpenAPI declaration file content
Enum:
description: xxx
oneOf:
- const: 'AAA'
description: 'AAA description'
- const: 'BBB'
description: 'BBB description'
deprecated: true
Generation Details
Any generator "out of the box"
Steps to reproduce
Use generator with OAS 3.1 file containing following fragment
Related issues/PRs
Issue is coming from OpenAPINormalizer file:
if (ModelUtils.isIntegerSchema(schema) || ModelUtils.isNumberSchema(schema) || ModelUtils.isStringSchema(schema)) {
// TODO convert oneOf const to enum
schema.setOneOf(null);
}
Suggest a fix
Remove the line resetting the information coming from specifications
Bug Report Checklist
Description
OpenAPINormalizer is discarding information from specification when using OAS 3.1 "const" to list enum values based onto oneOf.
Resetting the oneOf, means enums mist and related metadata are lost (e.g.
deprecatedvalues).openapi-generator version
pre-V7.19.0: commit id: 23eff66
OpenAPI declaration file content
Generation Details
Any generator "out of the box"
Steps to reproduce
Use generator with OAS 3.1 file containing following fragment
Related issues/PRs
Issue is coming from OpenAPINormalizer file:
Suggest a fix
Remove the line resetting the information coming from specifications