freeconf / restconf

Implementation of RESTCONF Management protocol - IETF RFC8040
Apache License 2.0
29 stars 10 forks source link

Response body for errors not valid in XML #57

Closed sebastien-guay closed 8 months ago

sebastien-guay commented 8 months ago

Here is an example of an errors body in xml:

<errResponseWrapper>
   <errors>
      <error>
         <error-type>protocol</error-type>
         <error-tag>access-denied</error-tag>
         <error-path>ietf-sztp-bootstrap-server:report-progress</error-path>
         <error-message>Bad ACL not authorized</error-message>
      </error>
   </errors>
</errResponseWrapper>

errResponseWrapper should not be there and xmlns must be set to "urn:ietf:params:xml:ns:yang:ietf-restconf"

https://github.com/freeconf/restconf/blob/9848fef17a9f8023f312d03dcef3f607aa408033/util.go#L87

dhubler commented 8 months ago

fixed See files for example responses https://github.com/freeconf/restconf/blob/master/testdata/gold/error.xml https://github.com/freeconf/restconf/blob/master/testdata/gold/error.json