Bug Report Checklist
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.
Bug Report Checklist
Description
In the
JsonConverter.Writemethod for enums, there is only this line: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
.ToStringwithBlahEnumValueConverter.ToJsonValue(blahEnum). I can open a PR for review.