nested instance identifer values

Description

The following instance-identifer value for node osiIf  

crosses a list element

whose key my-is-is:name is an intance-identifer ...

This following encoding seems reasonable as output of a GET,

in which the single quote characters are escaped

in the nested instance-idenfier value.

 

 

But it is not accepted by opendaylight sw, which raises the following error:

Environment

karaf 18.3

Activity

Show:

Robert Varga December 12, 2023 at 5:52 PM
Edited

This is not a bug.
The problem here is you are using XML entities to hide nested apostrophes – and those get replaced by the XML parser, as it it's job. That means your document's instance-identifier value is completely equivalent to the string we report in the error message – which is exactly what the XMLStreamReader gives us.

In order to make this case work, you need to use YANG string escaping, and since the embedded instance-identifier value uses single-quoted strings, the outer value needs to use double-quoted strings and escape the value using the rules associated with that.

See https://github.com/opendaylight/yangtools/blob/bab5285c29c41b6e25098fd1859803534d24324f/data/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/AbstractStringInstanceIdentifierCodec.java#L106-L127

I.e. the value should be:

Won't Do

Details

Assignee

Reporter

Priority

Created December 12, 2023 at 4:50 PM
Updated December 12, 2023 at 6:11 PM
Resolved December 12, 2023 at 5:52 PM