@SuppressWarnings("unchecked")
    public static <T> TypeInformation<T> convert(String jsonSchema) {
        Preconditions.checkNotNull(jsonSchema, "JSON schema");
        final ObjectMapper mapper = JacksonMapperFactory.createObjectMapper();
        mapper.getFactory()
                .enable(JsonParser.Feature.ALLOW_COMMENTS)
                .enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES)
                .enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
        final JsonNode node;
        try {
            node = mapper.readTree(jsonSchema);
        } catch (IOException e) {
            throw new IllegalArgumentException("Invalid JSON schema.", e);
        }
        return (TypeInformation<T>) convertType("<root>", node, node);
    }
@Test
    void testReferenceSchema() throws Exception {
        final URL url = getClass().getClassLoader().getResource("reference-schema.json");
        Objects.requireNonNull(url);
        final String schema = FileUtils.readFileUtf8(new File(url.getFile()));
        final TypeInformation<?> result = JsonRowSchemaConverter.convert(schema);

        final TypeInformation<?> expected =
                Types.ROW_NAMED(
                        new String[] {"billing_address", "shipping_address", "optional_address"},
                        Types.ROW_NAMED(
                                new String[] {"street_address", "city", "state"},
                                Types.STRING,
                                Types.STRING,
                                Types.STRING),
                        Types.ROW_NAMED(
                                new String[] {"street_address", "city", "state"},
                                Types.STRING,
                                Types.STRING,
                                Types.STRING),
                        Types.ROW_NAMED(
                                new String[] {"street_address", "city", "state"},
                                Types.STRING,
                                Types.STRING,
                                Types.STRING));

        assertThat(result).isEqualTo(expected);
    }