You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is your use-case and why do you need this feature?
I am working on an API, using ktor - and I've noticed the coerceInputValues config option.
On one hand, it allows us to make providing null equal to not providing anything at all (together with the explicitNulls option) in our API. To us, providing null means "no change than default", making it a valid input.
On the other hand, it turns invalid enum entries to the default - which can cause annoying, hard to fix bugs on the user's side.
Describe the solution you'd like
Separate it to two, different, config options.
The text was updated successfully, but these errors were encountered:
We had similar concerns while developing this feature, but it turns out that this is an unpopular use case. I can recommend you omitting values instead of sending nulls to keep defaults. It will also help with schema evolution — e.g., if you make property nullable, you won't suddenly start seeing nulls. Also, you would be able to differentiate new enum values from incorrect ones.
What is your use-case and why do you need this feature?
I am working on an API, using ktor - and I've noticed the
coerceInputValues
config option.On one hand, it allows us to make providing
null
equal to not providing anything at all (together with theexplicitNulls
option) in our API. To us, providingnull
means "no change than default", making it a valid input.On the other hand, it turns invalid enum entries to the default - which can cause annoying, hard to fix bugs on the user's side.
Describe the solution you'd like
Separate it to two, different, config options.
The text was updated successfully, but these errors were encountered: