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.

Environment

None

Activity

Show:
Done

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created April 5, 2024 at 12:18 PM
Updated May 29, 2024 at 4:47 PM
Resolved April 8, 2024 at 9:16 AM