RPC output cannot be written out via JSON/XML codecs
Description
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.
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.