cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1056
Views
0
Helpful
3
Replies

RESTCONF PATCH behaviour

LK2401
Level 1
Level 1

Is the difference in behaviour on these two restconf requests intended?
Platform is NSO 4.7.x
The first will produce 500 Internal Server - the latter works as expected.

{
  "ietf-yang-patch:yang-patch":{
    "patch-id":"deleteitnowplease",
    "edit":[
      {				
        "operation":"delete",
        "target":"/loopback-service:loopback-service=test1242",
	"edit-id":"remove-test"
      }
    ]
  }
}
{
  "ietf-yang-patch:yang-patch":{
    "patch-id":"deleteitnowplease",
    "edit":[
      {				
	"edit-id":"remove-test",
        "operation":"delete",
"target":"/loopback-service:loopback-service=test1242", } ] } }

 

3 Replies 3

tsiemers1
Spotlight
Spotlight

If you are below 4.7.4.1 they did have an error that produced the 500 response.

 

- restconf: Corrected the body format of yang-patch-status response

    message in success cases.

 

    (ENG-20606, RT:36346, PS-31425)

 

https://community.cisco.com/t5/nso-developer-hub-discussions/yang-patch-response/td-p/3900972

Both 4.7.7.4 and 4.7.7.6 gives me error 500

perander
Cisco Employee
Cisco Employee

This seems to be a bug actually. I have created an internal ticket for it.

 

Specifically, JSON encoding of lists [0] states that:

   Unlike the XML encoding, where list keys are required to precede any
   other siblings within a list entry and appear in the order specified
   by the data model, the order of members in a JSON-encoded list entry
   is arbitrary because JSON objects are fundamentally unordered
   collections of members.

 

[0]  https://tools.ietf.org/html/rfc7951#section-5.4

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?