{"record":{"id":"a6f48f776c1e5c09","repo":"apache/flink","slug":"invalid-json-schema","errorCode":null,"errorMessage":"Invalid JSON schema.","messagePattern":"Invalid JSON schema\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowSchemaConverter.java","lineNumber":110,"sourceCode":"     * Converts a JSON schema into Flink's type information. Throws an exception if the schema\n     * cannot converted because of loss of precision or too flexible schema.\n     *\n     * <p>The converter can resolve simple schema references to solve those cases where entities are\n     * defined at the beginning and then used throughout a document.\n     */\n    @SuppressWarnings(\"unchecked\")\n    public static <T> TypeInformation<T> convert(String jsonSchema) {\n        Preconditions.checkNotNull(jsonSchema, \"JSON schema\");\n        final ObjectMapper mapper = JacksonMapperFactory.createObjectMapper();\n        mapper.getFactory()\n                .enable(JsonParser.Feature.ALLOW_COMMENTS)\n                .enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES)\n                .enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);\n        final JsonNode node;\n        try {\n            node = mapper.readTree(jsonSchema);\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\"Invalid JSON schema.\", e);\n        }\n        return (TypeInformation<T>) convertType(\"<root>\", node, node);\n    }\n\n    private static TypeInformation<?> convertType(String location, JsonNode node, JsonNode root) {\n        // we use a set here to unify types (e.g. types that just add metadata such as 'multipleOf')\n        final Set<TypeInformation<?>> typeSet = new HashSet<>();\n\n        // search for ref\n        final Optional<JsonNode> ref;\n        if (node.has(REF) && node.get(REF).isTextual()) {\n            // try a simple ref resolver to solve those cases where entities are defined at\n            // the beginning and then used throughout a document\n            ref = Optional.of(resolveReference(node.get(REF).asText(), node, root));\n        } else {\n            ref = Optional.empty();\n        }\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowSchemaConverter.java#L92-L128","documentation":"Error \"Invalid JSON schema.\" thrown in apache/flink.","triggerScenarios":"Triggered at runtime when the operation fails because: Invalid JSON schema.","commonSituations":"Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Invalid JSON schema.","solutions":["Address the cause reported by the error message: Invalid JSON schema.","Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry."],"exampleFix":"Correct the condition described (\"Invalid JSON schema.\") and rerun the job or command.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}