UnionStringCodec does the wrong thing when it encounters a type which is not handled by TypeDefinitionAwareCodec: it falls back to invoking toString() on the value. The types not handled are: identityref, instance-identifier and leafref. One example of how this can go wrong is YANGTOOLS-1108. Let's just remove the codepath and start flushing out any offenders out there.
To achieve this, we will take two steps:
- we will remove the toString() fallback and perform an eager codec construction to see if we can handle the type at all. If we cannot, we will return null
- we will remove UnionStringCodec and always return it as unhandled
In this issue we will do the first item and introduce a system property to turn the behaviour to the second item.
- relates to
-
YANGTOOLS-1332 Remove concepts.IllegalArgumentCodec
- Resolved
-
NETCONF-845 Support of namespace for referred yang-identity values
- Resolved
- split to
-
YANGTOOLS-1560 Disable support for union TypeDefinitionAwareCodec by default
- In Review