-
-
Notifications
You must be signed in to change notification settings - Fork 158
Invalid Patch request body format required (most likely user error) #655
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
Comments
are you sure you're also adding the |
if so, if you can make a test that simulates the issue, we can start work on it very quickly. |
I would expect this to be an issue with the content type, indeed. Any update on this? |
If I remember correctly we changed the "id" member to be required as it required by the spec. Nevertheless the error should be more clear when when this occurs, it shouldn't just fall back on a reply with regular json output content |
@martinmike2 Can you please verify if #699 fixes your problem? |
Description
Either I am doing something incorrectly (likely), or there is an inconsistency with PATCH request required format (unlikely). I also realize that I am operating with an alpha version, and as such things might be goofy.
I am having a few issues, but the salient issue for this post is that I can't get a PATCH request to result in a deserialized type with the format specified in the json:api spec 1.0
Expected format per spec:
{ "data": { "type": "users", "id": 10, "attributes": { "userType": "Employee" } } }
This format actually results in a null type being presented to the JsonApiController PatchAsync method.
Actual format required to get a deserialized type that contains the value presented in the userType property (:
{ "type": "users", "id": "10", "userType": "Employee" }
All other imagined variations of the request body format either result in null types or types with default values that do not reflect the values passed in the request body.
...
Environment
-- Microsoft.AspNetCore.Mvc.NewtonsoftJson: 3.1.0
-- Newtonsoft.Json: 12.0.3
The text was updated successfully, but these errors were encountered: