[OPENIDM-3941] PATCH via REST with operation increment with invalid value returns 500 instead of 400 Created: 01/Sep/15  Updated: 19/Feb/16  Resolved: 19/Feb/16

Status: Closed
Project: OpenIDM
Component/s: Module - Connectivity for REST / http
Affects Version/s: OpenIDM 4.0.0
Fix Version/s: OpenIDM 4.0.0

Type: Bug Priority: Major
Reporter: Laurent Bristiel [X] (Inactive) Assignee: Travis Haagen
Resolution: Cannot Reproduce Votes: 0
Labels: CLARK, regression, release-notes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OpenIDM Trunk Jenkins Build 335


Issue Links:
Relates
relates to OPENIDM-3939 Some REST request failing with status... Closed
Story Points: 1
Sprint: OpenIDM Sprint 56

 Description   

PATCH via REST with operation increment with invalid value (we use a string instead of an integet) returns 500 instead of 400 since we use CREST 3.

with CREST 2.x

curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"increment","field":"/age","value":"9"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"
{
  "message": "Non-numeric value provided for increment patch operation",
  "reason": "Bad Request",
  "code": 400
}

with CREST 3

curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"increment","field":"/age","value":"9"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"

=> we get a status 500 and an empty response
(the empty response problem is already logged in OPENIDM-3939)



 Comments   
Comment by Travis Haagen [ 19/Feb/16 ]

Cannot Reproduce: Verified in master. Appears to give proper response

curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"increment","field":"/age","value":"9"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"

{"code":400,"reason":"Bad Request","message":"The request could not be processed because the provided content is not a valid JSON patch: Non-numeric value provided for increment operation"}

Must have been fixed by Alin Brici in OPENIDM-3939.

QA: please verify that this fix is in 4.0.0?

Comment by Laurent Bristiel [X] (Inactive) [ 19/Feb/16 ]

I confirm it is working well in 4.0.0 master
I missed it when it got resolved, sorry!

Generated at Sun Sep 27 20:37:09 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.