-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
In the JsonConverter.Write method for enums, there is only this line:
writer.WriteStringValue(counterEnum.ToString());
This causes enums to be written to JSON as "DailyMaintenance" or "MonthlyRinse" instead of "daily_maintenance" and "monthly_rinse" as they may be formatted in the OpenAPI specification.
openapi-generator version
7.14
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Define an enum in the specification which has values like "daily_maintenance" and "monthly_rinse"
Related issues/PRs
None that I could find.
Suggest a fix
It seems like we should replace .ToString with BlahEnumValueConverter.ToJsonValue(blahEnum). I can open a PR for review.
Reactions are currently unavailable