[NETCONF-1055] XML POST: Payloads are not well-formed XML documents Created: 13/Jun/23  Updated: 13/Jul/23

Status: Open
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Bug Priority: Highest
Reporter: Ivan Hrasko Assignee: Ivan Hrasko
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

According to XML Syntax (w3schools.com) XML documents must contain one root element that is the parent of all other elements.

But currently ODL is accepting POST XML requests like this:

<?xml version="1.0" encoding="UTF-8"?><topology-id xmlns="urn:TBD:params:xml:ns:yang:network-topology">topology-id</topology-id>

And rejects POST XML requests like this:

<?xml version="1.0" encoding="UTF-8"?><network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">    <topology-id xmlns="urn:TBD:params:xml:ns:yang:network-topology">topology-id</topology-id></network-topology> 

For http://192.168.56.25:8181/rests/data/network-topology:network-topology/topology=topology-id paths.



 Comments   
Comment by Ivan Hrasko [ 13/Jul/23 ]
   Example:

   To create a new "jukebox" resource, the client might send the
   following:

      POST /restconf/data HTTP/1.1
      Host: example.com
      Content-Type: application/yang-data+json

      { "example-jukebox:jukebox" : {} }

https://datatracker.ietf.org/doc/html/rfc8040#page-46

Comment by Ivan Hrasko [ 13/Jul/23 ]

https://datatracker.ietf.org/doc/html/rfc8040#appendix-B.2.1

Generated at Wed Feb 07 20:16:34 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.