[CONTROLLER-810] getting XML from RESTCONF results in unreadable namespaces (zdef#) Created: 11/Sep/14  Updated: 17/Oct/14  Resolved: 17/Oct/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Colin Dixon Assignee: Tony Tkacik
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Issue Links:
Duplicate
is duplicated by YANGTOOLS-297 XML namespaces are not preserved for ... Resolved
External issue ID: 1818

 Description   

For example fetching the TTP XML from RESTCONF starts like this:

GET http://localhost:8181/restconf/config/onf-ttp:opendaylight-ttps/onf-ttp:table-type-patterns/
Header: "Accept: application/xml"

<zdef-178745529:table-type-patterns xmlns:zdef-178745529="urn:onf:ttp">
<zdef-178745529:table-type-pattern>
<zdef-178745529:identifiers>
<zdef-178745529:var><subnet_VID></zdef-178745529:var>
<zdef-178745529:doc>The VLAN ID of a locally attached L2 subnet on a Router. </zdef-178745529:doc>
</zdef-178745529:identifiers>
<zdef-178745529:identifiers>
<zdef-178745529:var><group_entry_types/name></zdef-178745529:var>
<zdef-178745529:doc>of the type indicated by the variable name</zdef-178745529:doc>
<zdef-178745529:doc>An OpenFlow group identifier (integer) identifying a group table entry</zdef-178745529:doc>
</zdef-178745529:identifiers>
</zdef-178745529:table-type-pattern>
</zdef-178745529:table-type-patterns>

After posting this:

PUT: http://localhost:8181/restconf/config/onf-ttp:opendaylight-ttps/onf-ttp:table-type-patterns/
Headers: "Content-Type: application/json"

{
"table-type-patterns": {
"table-type-pattern": [
{
"identifiers": [

{ "var": "<subnet_VID>", "doc": [ "The VLAN ID of a locally attached L2 subnet on a Router." ] }

,

{ "var": "<group_entry_types/name>", "doc": [ "An OpenFlow group identifier (integer) identifying a group table entry", "of the type indicated by the variable name" ] }

]
}
]
}
}

The number after zdef appears to be random and changes on every request making simple comparisons impossible in addition to very user unfriendly.



 Comments   
Comment by Tony Tkacik [ 12/Sep/14 ]

This is more of consmetic issue. zdef- namespaces were introduced when we switched to XMLStream APIs for streaming content from datastore, instead of creating xml and then sending it.

zdef- namespaces are introduced by isNamespaceRepairing flag, which checks
and adds missing namespace definitions if necessary, this could be turned off
now, since we qualified codec which uses XMLStreamWriterto proper
emit namespace when necessary.

This Yangtools patchset will remove zdef for all elements except root of the mountpoint

https://git.opendaylight.org/gerrit/#/c/11109/

This patchset will remove zdef for mountpoints and turn off namespace repairing function from XMLStreamWriter API (which will increase performance):

The controller patch needs to be merged after yangtools one.

https://git.opendaylight.org/gerrit/#/c/11110/

Generated at Wed Feb 07 19:53:56 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.