@Override
    public Row deserialize(byte[] message) throws IOException {
        try {
            final JsonNode root = objectMapper.readTree(message);
            return (Row) runtimeConverter.convert(objectMapper, root);
        } catch (Throwable t) {
            if (ignoreParseErrors) {
                return null;
            }
            throw new IOException(
                    format("Failed to deserialize JSON '%s'.", new String(message)), t);
        }
    }
@Test
    public void testMissingNode() throws Exception {
        // Root
        ObjectNode root = OBJECT_MAPPER.createObjectNode();
        root.put("id", 123123123);
        byte[] serializedJson = OBJECT_MAPPER.writeValueAsBytes(root);

        TypeInformation<Row> rowTypeInformation =
                Types.ROW_NAMED(new String[] {"name"}, Types.STRING);

        JsonRowDeserializationSchema deserializationSchema =
                new JsonRowDeserializationSchema.Builder(rowTypeInformation).build();

        Row row = new Row(1);
        assertThat(
                        whenDeserializedWith(deserializationSchema)
                                .equalsTo(row)
                                .matches(serializedJson))
                .isTrue();

        deserializationSchema =
                new JsonRowDeserializationSchema.Builder(rowTypeInformation)
                        .failOnMissingField()
                        .build();
        final JsonRowDeserializationSchema errorDs = deserializationSchema;
        assertThatThrownBy(() -> errorDs.deserialize(serializedJson))
                .isInstanceOf(Exception.class)
                .hasMessageContaining("Failed to deserialize JSON");

        // ignore-parse-errors ignores missing field exception too
        deserializationSchema =
                new JsonRowDeserializationSchema.Builder(rowTypeInformation)
                        .ignoreParseErrors()
                        .build();
        assertThat(
                        whenDeserializedWith(deserializationSchema)
                                .equalsTo(row)
                                .matches(serializedJson))
                .isTrue();

        assertThatThrownBy(
                        () ->
                                new JsonRowDeserializationSchema.Builder(rowTypeInformation)
                                        .failOnMissingField()
                                        .ignoreParseErrors()
                                        .build())
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining(
                        "JSON format doesn't support failOnMissingField and ignoreParseErrors are both true");
    }