-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Resolves #1547: Make RemoveNullability virtual for extendability #1548
Conversation
Could you add a test case that demonstrates the type extension and overriding? This way we can ensure it won't be accidentally broken afterwards. |
Sure. But the current change is not changing any behaviour it just adds an extension point. While adding tests, what do you think of actually changing the current behaviour to only return the non nullable item if it is the only item in the collection?
or shorter
|
My point was mostly about the train of thought "why is this virtual, let's remove the virtual modifier", and the next release will be broken. So mainly about making compilation level guarantees in code base that you suggested change will be respected. |
I see. In the same class the method |
That might be a good idea, adds barrier for changing the modifier. This is mostly nit-picking, but compilation safety adds some guarantees. |
This allows to implement different logic e.g. treat JsonSchema.OneOf to have multiple (non nullable) items instead of zero or one.
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.
Looks good, thanks!
This allows to implement different logic e.g. treat JsonSchema.OneOf
to have multiple (non nullable) items instead of zero or one.