Skip to content
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

Option to ignore failed operations #57

Open
snebjorn opened this issue Jan 17, 2023 · 0 comments
Open

Option to ignore failed operations #57

snebjorn opened this issue Jan 17, 2023 · 0 comments

Comments

@snebjorn
Copy link

snebjorn commented Jan 17, 2023

Would be useful with an option to ignore operations that cannot be applied on the target.

Suggestion:

patch.ApplyTo(backendModel, ignoreErrors: true);

or

services
    .AddMvc()
    .AddJsonMergePatch(o => o.IgnoreErrors = true)

Not sure IgnoreErrors is the best name.

This is useful when the payload contains too many fields. In my specific scenario I'm dealing with polymorphism and the payload has a type field that is not present on the target model.
But it gets worse :( the payload doesn't care about polymorphism so it'll just send null values when a field isn't relevant. This isn't ideal, but it's what I have to deal with :/

Hope you'll consider it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant