[YANGTOOLS-1473] XML/JSON YangInstanceIdentifier codecs mis-handle key values Created: 03/Jan/23 Updated: 15/Mar/23 Resolved: 15/Mar/23 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | codecs, data-util |
| Affects Version/s: | 8.0.0, 9.0.0, 7.0.18, 10.0.4 |
| Fix Version/s: | 11.0.0, 8.0.10, 9.0.7, 10.0.5 |
| Type: | Bug | Priority: | Highest |
| Reporter: | Robert Varga | Assignee: | Ruslan Kashapov |
| Resolution: | Done | Votes: | 1 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
It seems AbstractStringInstanceIdentifierCodec is not handling values correctly, as it uses String.valueOf() on the object – bypassing any additional processing – so, for example, I do not believe in handles identityref and instance-identifier references correctly. Furthermore it does not perform any escaping, which probably means we cannot handle strings containing backslashes, or single quotes or double quotes. This relates to Write a set of tests to show how we handle these corner cases.
|
| Comments |
| Comment by Robert Varga [ 06/Jan/23 ] |
|
Tests are showing that at least yang-data-codec-gson is affected by this. The test suite requires:
I very much suspect this will be rather easy for JSON, but XML will need a bespoke solution to work in actual XML bodies, as we need to also emit namespace declarations as part of encoding. |
| Comment by Robert Varga [ 10/Jan/23 ] |
|
I suspect type bits is mis-handled as well. |