-
Notifications
You must be signed in to change notification settings - Fork 10k
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
PatchRequest fails with error The JSON value could not be converted to Microsoft.AspNetCore.JsonPatch.JsonPatchDocument #22620
Comments
You'll need to configure your app to use Newtonsoft.Json: https://docs.microsoft.com/en-us/aspnet/core/web-api/jsonpatch?view=aspnetcore-3.1#package-installation |
@pranavkm Ok, I see. Thanks for pointing that out to me. Adding
|
I ended up with this solution. Added the custom converters like this: services.AddControllers()
.AddNewtonsoftJson(options => {
options.SerializerSettings.Converters.Add(new JsonClaimConverter());
options.SerializerSettings.Converters.Add(new JsonClaimsPrincipalConverter());
options.SerializerSettings.Converters.Add(new JsonClaimsIdentityConverter());
}); |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Describe the bug
When I try to patch an object using v5.0.0-preview.4 I get the following error
To Reproduce
Create this
PATCH
methodThe user object is based on the following type with a couple more properties like this:
This is the
PATCH
request i'm using.Exceptions (if any)
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: