{"record":{"id":"cdce601ea366de21","repo":"apache/seatunnel","slug":"illegal-argument-cdce60","errorCode":"ILLEGAL_ARGUMENT","errorMessage":"JSON format doesn't support failOnMissingField and ignoreParseErrors are both enabled.","messagePattern":"JSON format doesn't support failOnMissingField and ignoreParseErrors are both enabled\\.","errorType":"error_code","errorClass":"SeaTunnelJsonFormatException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/JsonDeserializationSchema.java","lineNumber":74,"sourceCode":"    private final boolean ignoreParseErrors;\n\n    /** The row type of the produced {@link SeaTunnelRow}. */\n    private final SeaTunnelRowType rowType;\n\n    /**\n     * Runtime converter that converts {@link JsonNode}s into objects of internal data structures.\n     */\n    private JsonToRowConverters.JsonToObjectConverter runtimeConverter;\n\n    /** Object mapper for parsing the JSON. */\n    private final ObjectMapper objectMapper = new ObjectMapper();\n\n    private CatalogTable catalogTable;\n\n    public JsonDeserializationSchema(\n            boolean failOnMissingField, boolean ignoreParseErrors, SeaTunnelRowType rowType) {\n        if (ignoreParseErrors && failOnMissingField) {\n            throw new SeaTunnelJsonFormatException(\n                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                    \"JSON format doesn't support failOnMissingField and ignoreParseErrors are both enabled.\");\n        }\n        this.rowType = checkNotNull(rowType);\n        this.failOnMissingField = failOnMissingField;\n        this.ignoreParseErrors = ignoreParseErrors;\n        this.runtimeConverter =\n                new JsonToRowConverters(failOnMissingField, ignoreParseErrors)\n                        .createRowConverter(checkNotNull(rowType));\n\n        if (hasDecimalType(rowType)) {\n            objectMapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);\n        }\n        objectMapper.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true);\n    }\n\n    public JsonDeserializationSchema(\n            CatalogTable catalogTable, boolean failOnMissingField, boolean ignoreParseErrors) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/JsonDeserializationSchema.java#L56-L92","documentation":"JsonDeserializationSchema enforces that the two error-tolerance options are mutually exclusive: failOnMissingField (throw when a JSON field is absent) and ignoreParseErrors (skip malformed JSON records) cannot both be true, since one demands strict failure and the other silent tolerance. When both are enabled the constructor immediately throws SeaTunnelJsonFormatException with ILLEGAL_ARGUMENT. Fix your format configuration so exactly one policy is chosen.","triggerScenarios":"Constructing JsonDeserializationSchema(boolean failOnMissingField, boolean ignoreParseErrors, SeaTunnelRowType rowType) or JsonDeserializationSchema(CatalogTable catalogTable, boolean failOnMissingField, boolean ignoreParseErrors) with both flags set to true — typically via format config failOnMissingField=true and ignoreParseErrors=true in a JSON format block.","commonSituations":"Users copy a source config template that enables ignoreParseErrors and separately add failOnMissingField=true expecting stricter validation; both flags default or get set true in a shared HOCON/SQL options block.","solutions":["Set one of the two options to false in your format configuration — keep failOnMissingField=true and ignoreParseErrors=false for strict parsing, or ignoreParseErrors=true and failOnMissingField=false for tolerant parsing.","If strict validation is desired, remove the ignoreParseErrors option entirely (defaults to false).","If tolerant reading is desired, remove failOnMissingField or set it to false and instead supply default values via row-type definitions."],"exampleFix":"// before\nJsonDeserializationSchema schema = new JsonDeserializationSchema(true, true, rowType); // throws\n// after\nJsonDeserializationSchema schema = new JsonDeserializationSchema(true, false, rowType);","handlingStrategy":"validation","validationCode":"if (failOnMissingField && ignoreParseErrors) {\n    throw new IllegalArgumentException(\"failOnMissingField and ignoreParseErrors cannot both be true\");\n}\nJsonDeserializationSchema schema = new JsonDeserializationSchema(failOnMissingField, ignoreParseErrors, rowType);","typeGuard":null,"tryCatchPattern":"try {\n    schema = new JsonDeserializationSchema(failOnMissingField, ignoreParseErrors, rowType);\n} catch (SeaTunnelJsonFormatException e) {\n    // fall back to strict mode\n    schema = new JsonDeserializationSchema(failOnMissingField, false, rowType);\n}","preventionTips":["Decide one error policy per format config: strict (failOnMissingField) or tolerant (ignoreParseErrors), never both.","Add a config validation step in your deployment pipeline that rejects job configs with both flags true.","Know the defaults: ignoreParseErrors defaults to false, so only opt in explicitly."],"tags":["json","config","format","illegal-argument"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}