quarkiverse / quarkus-openapi-generator

OpenAPI Generator - REST Client Generator
Apache License 2.0
108 stars 66 forks source link

Support unexpected values in Enums #692

Closed brice-laurencin closed 2 weeks ago

brice-laurencin commented 3 months ago

If the server evolves and adds (or, God forbid, deletes) entries in an enum, the client will likely fail hard.

It'd be interesting to add a default UNEXPECTED value in all the generated enum, this one being the default value when parsing fails.

I can try to cook a PR for this, if you think that's a sensible idea.

ricardozanini commented 2 months ago

Feel free to experiment, @brice-laurencin. I'm curious about this use case since it's somewhat common. In my experience, usually the server would change the API to a new version e.g. /v2/petstore, then new clients can use this new endpoint and interface.

Changing the main version to not be compatible smells and it's an anti-pattern. So I'm not sure how much resources we should spend on this.

github-actions[bot] commented 3 weeks ago

@ricardozanini @hbelmiro This is being labeled as Stale.