Patch response body #2123
Answered
by
aklish
kelseybrennan
asked this question in
Q&A
Patch response body
#2123
-
Hi, is it possible to configure Elide to return the updated object in the response body for a PATCH operation? The JSON-API spec says that the response can either be a 200 OK or a 204 No Content (https://jsonapi.org/format/#crud-updating-responses). |
Beta Was this translation helpful? Give feedback.
Answered by
aklish
May 27, 2021
Replies: 1 comment 2 replies
-
I originally thought this was not supported, but it looks like support is there. If you set the following setting in ElideSettings to 200 (when you configure the Elide bean): which you can set by calling: It should change the behavior of patch requests to return the response body: |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kelseybrennan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I originally thought this was not supported, but it looks like support is there.
If you set the following setting in ElideSettings to 200 (when you configure the Elide bean):
https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/ElideSettings.java#L42
which you can set by calling:
https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/ElideSettingsBuilder.java#L161-L164
It should change the behavior of patch requests to return the response body:
https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/jsonapi/parser/state/BaseState.java#L173-L176