[YANGTOOLS-1543] XmlStringInstanceIdentifierCodec is using JSON encoding for writeValue() Created: 27/Sep/23  Updated: 02/Oct/23  Resolved: 02/Oct/23

Status: Resolved
Project: yangtools
Component/s: codecs
Affects Version/s: 8.0.10, 9.0.8, 10.0.9, 11.0.2
Fix Version/s: 9.0.9, 10.0.10, 11.0.3

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-1130 (devices) POST returns 500 on data al... Resolved
Issue split
split to YANGTOOLS-1544 Enhance XML prefix assignment Resolved

 Description   

This was discovered downstream. As it turns out we have two codecs, XmlStringInstanceIdentifierCodec and RandomPrefixInstanceIdentifierSerializer.

The latter is performing correct encoding, emitting XML namespace declarations as appropriate.

The former is exposed as the official instance identifier codec, but it does the wrong thing: it uses module names instead of emitting XML namespace declarations. Related UT are asserting this, but the test cases are ambiguous: modules used for testing have the same name and prefix arguments. The assertions therefore match what we would want for our end result to be.

XmlStringInstanceIdentifierCodec does not implement the write path, so perhaps we should just unify them as a first step.

The second, separate, step is then to improve RandomPrefixInstanceIdentifierSerializer so it creates prefixes based on the module's 'prefix' statement (if that mapping refers to a unique XMLNamespace throughout th EffectiveModelContext we operate on).



 Comments   
Comment by Robert Varga [ 27/Sep/23 ]

The prefix emission problem shows up as a regression in NETCONF-1130 tests.

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