Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1543

XmlStringInstanceIdentifierCodec is using JSON encoding for writeValue()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 9.0.9, 10.0.10, 11.0.3
    • 8.0.10, 9.0.8, 10.0.9, 11.0.2
    • codecs

      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).

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: