Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Done
-
Istanbul Release
-
None
Description
Expected behaviour:
- When sending a request to update a node leave, either
- the request is successfully proceeded and response code is 2xx
- or client request is not valid and response code is 4xx with a meaningful explanation of the reason why the request is not valid.
Actual behaviour:
- Request is not proceeded, response code is 400 and error message complains about json data not able to be parsed. Json format seems correct.
Steps to reproduce:
1. Create a dataspace:
curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces?dataspace-name=bsa-dataspace-7' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
2. Create a schema set with attached bookstore.yang
curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/schema-sets' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \-F 'file=@"/bookstore.yang"' \-F 'schema-set-name="bsa-schema-set"'
3. Create an anchor
curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors?schema-set-name=bsa-schema-set&anchor-name=bsa-anchor' \ -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
4. Add a node
curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors/bsa-anchor/nodes' \ -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \ -H 'Content-Type: application/json' \ --data-raw '{ "bookstore":{ "bookstore-name": "Chapters", "categories": [ { "code": "01", "name": "SciFi", "books": [ { "authors": [ "Iain M. Banks" ], "lang": "en", "price": "895", "pub_year": "1994", "title": "Feersum Endjinn" }, { "authors": [ "Ursula K. Le Guin", "Joe Haldeman", "Orson Scott Card", "david Brin", "Rober Silverberg", "Dan Simmons", "Greg Bear" ], "lang": "en", "price": "1099", "pub_year": "1999", "title": "Far Horizons" } ] }, { "name": "kids", "code": "02", "books": [ { "authors": [ "Philip Pullman" ], "lang": "en", "price": "699", "pub_year": "1995", "title": "The Golden Compass" } ] } ] } } '
5. Update a node leaf:
curl -g -X PATCH 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors/bsa-anchor/nodes?xpath=/bookstore/categories[@code=%2701%27]' \ -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \ -H 'Content-Type: application/json' \ --data-raw '{ "code": "01", "name": "bsa" }'
Http response is:
{ "status": "400 BAD_REQUEST", "message": "Failed to parse json data: {\n \"code\": \"01\",\n \"name\": \"bsa\"\n}", "details": "Normalized Node result was already set." }
See error.log for the logs
Attachments
Issue Links
- relates to
-
CPS-464 Request to update node leaves (patch) responds with Internal Server Error
-
- Closed
-