-
Notifications
You must be signed in to change notification settings - Fork 44
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
How to make an option field be required for deserializing? #123
Comments
Right, we need to support |
Awesome, thanks! This will help a ton. |
While updating to release version, our CI hits the breaking change :(
Am I missing a trick (without changing all option properties to |
The new option SkippableOptionFields was added in v1.1 for this use case. https://github.com/Tarmil/FSharp.SystemTextJson/blob/master/docs/Customizing.md#skippable-option-fields |
Is there a way to have an option field be required?
For example, if
LastName
here is null, it should be set toNone
, but if it's missing in the json, it should throw an exception.Reason being that I want to make sure an API consumer isn't accidentally missing a field.
I'm assuming this is why we would use
Skippable
withIgnoreNullValues
, but the latter's been deprecated, and the new one it suggests seems to have no effect.The text was updated successfully, but these errors were encountered: