Rework YangInstanceIdentifier/URI path conversion
YangInstanceIdentifierSerializer has a rather ambiguous name and
description, but essentially it does what it advertizes: it takes a
YangInstanceIdentifier and creates a String corresponding to
ApiPath.parse().
Unfortunately this process handles values through String.valueOf(),
which obviously does the wrong thing for non-trivial values, such as
identityref and instance-identifier.
We already have a component handling ApiPath -> YangInstanceIdentifier
conversion, the ApiPathNormalizer.
This patch completely replaces
YangInstanceIdentifierSerializer.serializePath() with
ApiPathNormalizer.canonicalize(). It essentially does the same thing,
but returns an ApiPath as the result. Users can use ApiPath.toString()
to then get the String representation, if needed.
JIRA: NETCONF-1264
Change-Id: I1093eb2cbd84ae269430f918e48b98cc2fb4e805
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>