You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the above generator command with the above input yaml
Observe that the output yaml matches the actual output yaml shown above
Related issues/PRs
None that I could find
Suggest a fix
In ExampleGenerator.resolveModelToExample, the schema should be processed if it is a valid enum (i.e. it has an enum field and that field is a non-empty sequence). This check should be placed here:
alexrjones
changed the title
[BUG][yaml] Null example values generated for enum properties
[BUG] Null example values generated for enum properties
May 9, 2024
Bug Report Checklist
Description
If a schema has a property that references an enum schema, the example will generate
null
values for the schema.openapi-generator version
7.5.0
OpenAPI declaration file content or url
Input:
Expected output:
Actual output:
Generation Details
openapi-generator-cli generate -i "<input-yaml>" -g openapi-yaml
Steps to reproduce
Related issues/PRs
None that I could find
Suggest a fix
In
ExampleGenerator.resolveModelToExample
, the schema should be processed if it is a valid enum (i.e. it has anenum
field and that field is a non-empty sequence). This check should be placed here:openapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java
Lines 380 to 385 in e361720
The text was updated successfully, but these errors were encountered: