Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix enum serdes generated from codegen #3085

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

hughsimpson
Copy link
Contributor

@hughsimpson hughsimpson commented Jul 31, 2023

Whilst it compiled, actually using the generated tapir code for enumeratum failed at runtime with Invalid value for: body (JSON decoding to CNil should never happen at 'myEnumField')

I have actually tested that the generated code works this time around

Additionally, it looks like enums should have an explicit type specified (cf https://swagger.io/docs/specification/data-models/enums/) - I've updated the decoder to require that the type is string (we don't support any other types at present) and shuffled the decoder ordering so that we don't decode an enum to a OpenapiSchemaString if type: string is present

@hughsimpson hughsimpson changed the title fix scala 2 enum serdes generated from codegen fix enum serdes generated from codegen Aug 2, 2023
@kciesielski kciesielski merged commit e5bd96c into softwaremill:master Aug 10, 2023
@hughsimpson hughsimpson deleted the fix_enum_codec branch August 11, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants