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

JSON codec fails to decode instance-identifier to a choice/case/choice item

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • 6.0.0, 7.0.0, 8.0.0, 6.0.12, 7.0.14
    • 7.0.15, 8.0.2
    • data-util
    • None

    Description

      With the following model:

      module foo {
        namespace foo;
        prefix foo;
      
        choice foo {
          case bar {
            choice baz {
              leaf xyzzy {
                type string;
              }
            }
          }
        }
      }

      Attempting to parse "/foo:xyzzy" as an instance-identifier leaf in JSON results in a NullPointerException:

      java.lang.NullPointerException
      	at org.opendaylight.yangtools.yang.data.util.XpathStringParsingPathArgumentBuilder.nextContextNode(XpathStringParsingPathArgumentBuilder.java:114)
      	at org.opendaylight.yangtools.yang.data.util.XpathStringParsingPathArgumentBuilder.computeIdentifier(XpathStringParsingPathArgumentBuilder.java:180)
      	at org.opendaylight.yangtools.yang.data.util.XpathStringParsingPathArgumentBuilder.computeNextArgument(XpathStringParsingPathArgumentBuilder.java:104)
      	at org.opendaylight.yangtools.yang.data.util.XpathStringParsingPathArgumentBuilder.build(XpathStringParsingPathArgumentBuilder.java:91)
      	at org.opendaylight.yangtools.yang.data.util.AbstractStringInstanceIdentifierCodec.deserializeImpl(AbstractStringInstanceIdentifierCodec.java:102)
      	at org.opendaylight.yangtools.yang.data.util.AbstractStringInstanceIdentifierCodec.deserializeImpl(AbstractStringInstanceIdentifierCodec.java:1)
      	at org.opendaylight.yangtools.concepts.AbstractIllegalArgumentCodec.deserialize(AbstractIllegalArgumentCodec.java:30)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JSONInstanceIdentifierCodec.parseValue(JSONInstanceIdentifierCodec.java:71)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JSONInstanceIdentifierCodec.parseValue(JSONInstanceIdentifierCodec.java:1)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.translateValueByType(JsonParserStream.java:372)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.setValue(JsonParserStream.java:366)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:270)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:336)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:286)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:336)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:336)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.parse(JsonParserStream.java:193)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: