-
Notifications
You must be signed in to change notification settings - Fork 19
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
SystemTextJson: Add option to reject null string values #87
Conversation
TL;DR if this was off by default, I'd probably just merge it without much discussion. If I truly hated it as a default, I'd insist on it simply being changed to that. However, the truth is I'm torn. In general I agree that apps are better off with I don't believe anything in github.com/jet will break based on it (but I had to check - e.g. the The elephant in the room is the fact that this is a breaking change for FsCodec an'd we're not in version 0.x. As we're in a phase where FsCodec and Equinox are in RC, that's less significant than it ordinarily would be (and it's not a binary breaking change). However, I can definitely picture people being surprised and ending up with broken production systems. The simplest way to address this is to add an optional argument to The next level is to make it a non-optional argument in
As it stands, this is a thus a pretty big change to force on people. Other aspects:
In my world, I tend to have two places in my app where I would be able to configure things (and I personally would immediately switch it on):
Thoughts, @deviousasti @enricosada @wantastic84 - do you have a preference for default off, default on, or force choice via having Conclusions:
These are the doc sections this should be covered in (perhaps a dedicated section near the top with an anchor that can be referenced by the sections might help?) |
OK now that the default is flipped, the main remaining thing other than the minor review comment things is to mention the converter in the README in the cited places (perhaps with a small section illustrating how Am still slightly torn on what the default should be, but I guess the simplification of the PR shows its probably for the best... |
Co-authored-by: Ruben Bartelink <[email protected]>
Looks great, thanks! |
Adds a
StringConverter
to the converter list by default. This converter will throw when deserializing a string that's set tonull
Before this change this would return null:
After this change the above throws. Also affects properties on records.
I'm also updating FsCheck to the 3.0.0-* branch because it doesn't emit null as a legal string