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

Pass CanBeNull to string serializer and converter #47

Merged
merged 6 commits into from
Jan 7, 2023

Conversation

Rutherther
Copy link
Owner

This resolves #25.

The IStringConverter and IStringSerializer was modified to receive DeserializeOptions as last parameter of Deserialize method. That contains CanBeNull. Serialize assumes null shall be serialized as null, no options need to be passed. If there is an object that may not be null and it will be serialized, it should not be null in the first place, that's the reason serialize options are not needed.

When CanBeNull is true, the behavior is the same. When it's null, "null strings" ("-1", "-") are treated like their actual value instead of null.

@Rutherther Rutherther merged commit e67bb2b into main Jan 7, 2023
@Rutherther Rutherther deleted the feat/pass-nullable branch January 7, 2023 13:51
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.

Pass "can be null" to string converters
1 participant