-
Notifications
You must be signed in to change notification settings - Fork 6
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
generify tristate module as reusable module #108
base: main
Are you sure you want to change the base?
Conversation
} | ||
} | ||
|
||
public object OptionSerializerResolver : Serializers.Base() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these public members in this file need to have a deprecation cycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @i-walker that's a really good point. I'll defer the refactoring of option module as another issue entirely. I think several of these modules access modifier shouldn't have been public. I'll address that separately after this PR.
468b78b
to
e5a26e6
Compare
In this PR
GenericTriStateModule<T>
as a base of tristate (undefined | null | value) serde.fixes #107
Context
There are times where users need to model an API that need differentiate between:
Option is a very specific case of the above where both absence and presence of a field with a null value indicates a
None
.However it's important to note that these generalizations sometimes do not apply. For instance for PATCH endpoints where null means remove, and undefined means do nothing. In this PR we're extracting out this functionality as a separate module that users will be able to customize to support their requirements accordingly.
An example usage of the
GenericTriStateModule<T>
to form an option module is as follows:Out of scope