Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DateIssue/QuestionsDecisions

 

Should dry-run be a path parameter or a query parameter? 

dry-run flag should be an optional query parameter, making it part of path parameter will result in change in multiple endpoints using this feature. List of these APIs can be found below. And changing the path/endpoint by using dry-run as path parameter may impact backwards compatibility of these APIs

Overview

Currently when persisting any data in CPS the data validation is performed using the yang schema and upon successful validation the data is stored in CPS DB. But in case the data validation fails a 500 response is returned by CPS.

...


NameEndpointIssueRequired Action
1Create a Node/{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodesReturns 500 status on data validation failure

Return 400 status with updated and detailed error message.

Updated Message:

Code Block
{
"status": "400 BAD_REQUEST",
"message": "Data Validation Failed",
"Schema node with name "Node" was not found 
under (urn:ietf:params:xml:ns:netconf:base:1.0)data." 
}


2Update Node Leaves/{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodesReturns 400 status with entire JSON payload in error message
3Replace Nodes/{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodesReturns 400 status with entire JSON payload in error message
4Add List Element/{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodesReturns 500 status on data validation failure
5Replace List element/{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodesReturns 400 status with entire JSON payload in error message6Get Delta between anchor and JSON payload/v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/deltaAnchorsReturns 400 status with entire JSON payload in error message

...