-
Notifications
You must be signed in to change notification settings - Fork 47
Honour Validation attributes #18
Comments
Object validation of HTTP data using validation attributes is an MVC feature. What is your end-to-end scenario? Why have you chosen not to use MVC in this scenario? |
We are using MVC. In the above scenario we'd have to manually invoke the validator on every patched object. You're currently doing type checking - it would be good if we had the ability to override this behaviour to also perform additional validation. |
Seems reasonable to me, but this isn't planned at this time. |
Maybe you could do a separate Package to augment JsonPatch for MVC purposes, like |
+1 for this feature |
Also, It'll be great to honour validation rules of fluentValidation |
For those looking for a copy paste solution to this, you need to call
It's also worth noting that the JSON patch document could also be invalid, so you need to check the model state twice. If you are using ASP.NET Core 1.0, then note that |
Closing because there are no plans to implement this. Using |
@Eilon Is this because of the disconnect between ASP.NET Core and MVC? I've heard there are plans to remove that disconnect although that statement is vague, could this issue be reopened once that happens? |
Currently only type checking is performed. It would be good if the object adaptor also honoured validation attributes on the object for example:
Currently I could set the age property to
10
using a patch operation.The text was updated successfully, but these errors were encountered: