@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 testComplexSchema() throws Exception {
        final URL url = getClass().getClassLoader().getResource("complex-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[] {
                            "fn",
                            "familyName",
                            "additionalName",
                            "tuples",
                            "honorificPrefix",
                            "url",
                            "email",
                            "tel",
                            "sound",
                            "org"
                        },
                        Types.STRING,
                        Types.STRING,
                        Types.BOOLEAN,
                        Types.ROW(Types.BIG_DEC, Types.STRING, Types.STRING, Types.STRING),
                        Types.OBJECT_ARRAY(Types.STRING),
                        Types.STRING,
                        Types.ROW_NAMED(new String[] {"type", "value"}, Types.STRING, Types.STRING),
                        Types.ROW_NAMED(
                                new String[] {"type", "value"}, Types.BIG_DEC, Types.STRING),
                        Types.VOID,
                        Types.ROW_NAMED(new String[] {"organizationUnit"}, Types.ROW()));

        assertThat(result).isEqualTo(expected);
    }