{"record":{"id":"62de00d57de0accd","repo":"apache/seatunnel","slug":"could-not-parse-json-value-s","errorCode":null,"errorMessage":"Could not parse json, value: %s","messagePattern":"Could not parse json, value: (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java","lineNumber":312,"sourceCode":"                .orElseThrow(\n                        () ->\n                                new IllegalArgumentException(\n                                        String.format(\n                                                \"Could not parse value for enum %s. Expected one of: [%s]\",\n                                                clazz, Arrays.toString(clazz.getEnumConstants()))));\n    }\n\n    public static String convertToJsonString(Object o) {\n        if (o == null) {\n            return null;\n        }\n        if (o instanceof String) {\n            return (String) o;\n        }\n        try {\n            return JACKSON_MAPPER.writeValueAsString(o);\n        } catch (JsonProcessingException e) {\n            throw new IllegalArgumentException(String.format(\"Could not parse json, value: %s\", o));\n        }\n    }\n\n    public static String convertToJsonString(Config config) {\n        return convertToJsonString(config.root().unwrapped());\n    }\n\n    public static Config convertToConfig(String configJson) {\n        return ConfigFactory.parseString(configJson);\n    }\n}\n","sourceCodeStart":294,"sourceCodeEnd":324,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java#L294-L324","documentation":"A generic serialization guard in ConfigUtil.convertToJsonString: the object being converted to its JSON string representation could not be serialized by the underlying JSON library. It fires on any non-String, non-null object whose type is not supported (non-bean types, unserializable classes).","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the object passed to convertToJsonString is a simple type, Map, Collection, or a bean with a no-arg constructor and getters","Convert unsupported custom types to a Map or String before serialization","Inspect the value logged in the message to identify which object failed serialization"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}