You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A PATCH / PUT request returns true while other REST endpoints return a JSON output. Should these methods also return a JSON response to be consistent?
Current Behavior
Returns a boolean for PATCH / PUT
Expected Behavior
Return JSON ... something like {success: true} or {result: <value-returned-by-juggler>}
Update existing code / templates / tests
cc: @strongloop/sq-lb-apex @raymondfeng@bajtos Thoughts? Is this the intended behaviour or a bug? If it's the intended behaviour, do we want to look into changing it for LB4?
+1 for returning a JSON like {success: true} or perhaps {result: <value-returned-by-juggler>}.
Please note that we cannot return full model data in most cases. It would require another database command to fetch the updated model instance, which would introduce race condition.
I am going to label this as a bug and assign to Core-GA backlog for consideration.
+1 for returning a JSON result. Agree with Miroslav's comment. And it also allows we to customize result details, e.g. Cloudant includes which data fails update and which one passes.
Description / Steps to reproduce / Feature proposal
From #1206
A
PATCH
/PUT
request returnstrue
while other REST endpoints return a JSON output. Should these methods also return a JSON response to be consistent?Current Behavior
boolean
for PATCH / PUTExpected Behavior
JSON
... something like{success: true}
or{result: <value-returned-by-juggler>}
cc: @strongloop/sq-lb-apex @raymondfeng @bajtos Thoughts? Is this the intended behaviour or a bug? If it's the intended behaviour, do we want to look into changing it for LB4?
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: