Added option to treat unknown XML (wrt YANG) as anydata.
This commit is contained in:
parent
12d1b67250
commit
dafc6d10e0
15 changed files with 80 additions and 8 deletions
|
|
@ -282,8 +282,10 @@ new "restconf delete identity"
|
|||
expectpart "$(curl -s -i -X DELETE http://localhost/restconf/data/example:crypto)" 0 "HTTP/1.1 204 No Content"
|
||||
|
||||
# 2. set identity in other module with restconf , read it with restconf and netconf
|
||||
if ! $YANG_UNKNOWN_ANYDATA ; then
|
||||
new "restconf add POST instead of PUT (should fail)"
|
||||
expectpart "$(curl -s -i -X POST -H "Content-Type: application/yang-data+json" http://localhost/restconf/data/example:crypto -d '{"example:crypto":"example-des:des3"}')" 0 'HTTP/1.1 400 Bad Request' '{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"bad-element","error-info":{"bad-element":"crypto"},"error-severity":"error","error-message":"Failed to find YANG spec of XML node: crypto with parent: crypto in namespace: urn:example:my-crypto"}}}'
|
||||
fi
|
||||
|
||||
# Alternative error:
|
||||
#'{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"unknown-element","error-info":{"bad-element":"crypto"},"error-severity":"error","error-message":"Leaf contains sub-element"}}}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue