-
-
Notifications
You must be signed in to change notification settings - Fork 158
PATCH Successfully but Return Data is Null #870
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
This is by design. See the json:api spec. We only return the changed resource when the update caused side effects in attributes that the client cannot know about. |
Relevant quote from the json:api spec:
|
This is actually broken in master (which returns 200 with data:null instead of 204), but fixed in #851, which we'll merge before the next release. |
Ok if it's like that. I'm just learning the json: api spec. So, does PATCH not return modified data? Thank you for the quick response. |
Only when side effects occur. For example, if you have a database trigger that sets LastModifiedAt column on each update. The api user cannot know, so we send back the full resource. If there are no side effects, we don't send back the resource for efficiency. The client already knows what has changed. |
Thanks for the information. With this explanation, I can understand. |
Description
I tried to PATCH the department resource. Request body as below:
The data has been changed successfully, but the response data received is: null.
The response should have received changed data right?
...
Environment
The text was updated successfully, but these errors were encountered: