Fix String value parsing/serialization 41/103941/24
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 6 Jan 2023 15:30:27 +0000 (16:30 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 15 Mar 2023 13:17:16 +0000 (13:17 +0000)
commitf31f6f001ec2263715ebfd5f28d214b56e9a0344
treed91ca7e0d66b99791d8759d646dbba0a5d2c9d4d
parent3882dd90f1af909696a4e1ebad57aae1282cf956
Fix String value parsing/serialization

When encoding user-supplied values from user we need to be mindful of
their actual content: we cannot just use single quotes (') everywhere,
as the value itself can contain a single quote, in which case the
resulting string would have unbalanced quotes and nominally unparseable.

Adjust both sides of the serialization picture to account for this and
use YANG section 6.1.3 for escaping rules.

JIRA: YANGTOOLS-1473
Change-Id: I0df9beaf720a78682b6bde606a1359e7f1a09df8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
codec/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/YT1473Test.java
codec/yang-data-codec-xml/src/test/java/org/opendaylight/yangtools/yang/data/codec/xml/YT1473Test.java
data/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/AbstractStringInstanceIdentifierCodec.java
data/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/XpathStringParsingPathArgumentBuilder.java