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

RPC output cannot be written out via JSON/XML codecs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 13.0.3, 11.0.7
    • 10.0.12, 9.0.10, 13.0.0, 11.0.6
    • codecs, data-util

      Attempting to use

      {JSON,XML}

      NormalizedNodeStreamWriter with an EffectiveStatementInference pointing to an RpcEffectiveStatement, such as when attempting to write out a document containing the 'input' or 'output' fails with:

      java.lang.IllegalArgumentException: Cannot instantiate on RpcEffectiveStatementImpl{argument=(invoke:rpc:module?revision=2013-12-03)rpc-test}
      	at org.opendaylight.yangtools.yang.data.util.NormalizedNodeStreamWriterStack.<init>(NormalizedNodeStreamWriterStack.java:76)
      	at org.opendaylight.yangtools.yang.data.util.NormalizedNodeStreamWriterStack.of(NormalizedNodeStreamWriterStack.java:91)
      	at org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter.createNestedWriter(JSONNormalizedNodeStreamWriter.java:302)
      

      This leads to users needing to deploy workarounds, such as emitting the top element (input/output) and then emitting child elements.

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

              Created:
              Updated:
              Resolved: