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.
This allows to implement different logic e.g. treat JsonSchema.OneOf
to have multiple (non nullable) items instead of zero or one.