You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting this to false should result in ModelState.IsValue to be true when the only issue is that not all required properties are present in the request body.
To me it would be more logical that eventually this is the default, although the current behaviour could be useful to have in some specific situations, so the option switch seems the best way.
The text was updated successfully, but these errors were encountered:
It's a known issue in the ReadMe. Shouldn't it be an Issue here?
The way I see it the whole point of using the JsonMergePatchDocument is to have patches that don't have to supply values for properties that aren't being changed, so to me this defeats the purpose. I don't want to have the properties on my models be nullable if they always (should) have values.
I don't think this could work, There is always a whole model in memory and the validator does not know which properties are set. Also Required is not the only attribute.
Anyway if you think you can make it work then feel free to make a PR
As this could be considered a breaking change, maybe initially this behaviour should be opt-in.
builder.Add***JsonMergePatch(o => o.InheritRequirementsFromModel = false)
Setting this to false should result in ModelState.IsValue to be true when the only issue is that not all required properties are present in the request body.
To me it would be more logical that eventually this is the default, although the current behaviour could be useful to have in some specific situations, so the option switch seems the best way.
The text was updated successfully, but these errors were encountered: