class JsonNodeConverter implements NodeConverter {

    @Override
    public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData)
            throws SerializationException {
        NormalizedNodeResult result = new NormalizedNodeResult();
        JSONCodecFactory jsonCodecFactory =
                JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02.createLazy(schemaContext);
        try (JsonReader reader = new JsonReader(inputData);
                NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result);

                JsonParserStream jsonParser = JsonParserStream.create(streamWriter, jsonCodecFactory, schemaNode)) {
            jsonParser.parse(reader);
        } catch (IOException e) {
            throw new SerializationException(e);
        }
        return result.getResult();
    }

}

class JsonNodeConverterTest  {

    private static final Logger LOG;
    private final NodeConverter bindingSerializer;

    @Test
    public void testDeserialize_in() throws Exception {

        Optional<RpcDefinition> loadRpc = ConverterUtils.loadRpc(schemaContext, SIMPLE_IO_RPC_QNAME);
        String loadIoRpcIn = loadResourceAsString("input-output-rpc-in.json");
        NormalizedNode<?, ?> deserializeRpc =
                bindingSerializer.deserialize(loadRpc.get(), new StringReader(loadIoRpcIn));
        Assert.assertNotNull(deserializeRpc);
        LOG.info(deserializeRpc.toString());
    }

}