OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.47k stars 6.49k forks source link

[REQ] [jaxrs-spec] Support for case-insensitive string enums for jaxrs-spec #17398

Open mgq0 opened 9 months ago

mgq0 commented 9 months ago

Is your feature request related to a problem? Please describe.

Given the following enum spec:

enum:
- HDD
- SSD
- NVME
type: string

The jaxrs-spec generator will generate an enum that does strict == comparisons, so if the specified API returns NVMe instead of NVME, the response will fail validation because"NVMe" != "NVME".

Describe the solution you'd like

The Java generator supports a useEnumCaseInsensitiveoption; when that option is enabled, the generator will use case-insensitive equality checks for string enums. Copying that feature into the jaxrs-spec generator would enable generator users to opt in to case-insensitive comparisons for string enums.

Additional context

Relates to issue 16634

raphisuter commented 4 months ago

any news on this topic?

mgq0 commented 3 months ago

Unfortunately no..