OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
With the recent Change, the Enum Validation for API generated for Microservices is not working anymore.
The Spring AbstractNamedValueArgumentResolver -> StringToEnumConverterFactory is using Name Mapping (via Enum.valueOf) to parse an Enum on Validation.
With the Change, the Name and The Value of the Enum can differ, so a ServerInput Error is raised
Example
OAS3 Enum Value: B2C
Before the Change, the Enum Constant is generated like this: B2C
After the Change, it is: B2_C
The StringToEnumConverterFactory in Spring fails to map now a request &something=B2C while a request with &something=B2_C is passing
Relates to https://github.com/OpenAPITools/openapi-generator/issues/4837
With the recent Change, the Enum Validation for API generated for Microservices is not working anymore. The Spring
AbstractNamedValueArgumentResolver
->StringToEnumConverterFactory
is using Name Mapping (viaEnum.valueOf
) to parse an Enum on Validation. With the Change, the Name and The Value of the Enum can differ, so a ServerInput Error is raisedExample
OAS3 Enum Value:
B2C
Before the Change, the Enum Constant is generated like this:B2C
After the Change, it is: B2_CThe
StringToEnumConverterFactory
in Spring fails to map now a request&something=B2C
while a request with&something=B2_C
is passing