{"record":{"id":"94036ddc89f0b075","repo":"apache/seatunnel","slug":"invalid-sort-json","errorCode":null,"errorMessage":"Invalid sort JSON: ","messagePattern":"Invalid sort JSON: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-airtable/src/main/java/org/apache/seatunnel/connectors/seatunnel/airtable/source/config/AirtableSourceParameter.java","lineNumber":178,"sourceCode":"    }\n\n    private void checkConflict(\n            ReadonlyConfig pluginConfig,\n            Map<String, Object> body,\n            Option<?> option,\n            String bodyKey,\n            List<String> conflicts) {\n        if (pluginConfig.getOptional(option).isPresent() && body.containsKey(bodyKey)) {\n            conflicts.add(bodyKey + \" (option: \" + option.key() + \")\");\n        }\n    }\n\n    private Object parseSort(String sortJson) {\n        try {\n            return JsonUtils.parseObject(\n                    sortJson, new TypeReference<List<Map<String, Object>>>() {});\n        } catch (RuntimeException e) {\n            throw new IllegalArgumentException(\"Invalid sort JSON: \" + sortJson, e);\n        }\n    }\n}\n","sourceCodeStart":160,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-airtable/src/main/java/org/apache/seatunnel/connectors/seatunnel/airtable/source/config/AirtableSourceParameter.java#L160-L182","documentation":"AirtableSourceParameter.parseSort throws IllegalArgumentException 'Invalid sort JSON: <input>' when the 'sort' option is not valid JSON shaped as a list of objects (List<Map<String,Object>>) as Airtable's API expects. The parse exception from JsonUtils is attached as the cause.","triggerScenarios":"Setting sort = \"[{field: \\\"Name\\\", direction: \\\"asc\\\"}]\" without quoting keys, or passing a bare string/array-formatted HOCON that fails JSON parsing when the source builds its request body.","commonSituations":"Hand-writing sort JSON in HOCON where keys are unquoted or values use single quotes; wrapping the array in an extra string; confusing Airtable's sort format with plain field names.","solutions":["Write valid JSON with quoted keys and double-quoted string values: sort = \"[{\\\"field\\\":\\\"Name\\\",\\\"direction\\\":\\\"asc\\\"}]\".","Validate the JSON in a linter before putting it in the config.","Ensure the top-level shape is a JSON array of objects, not a string or single object."],"exampleFix":"// before\nsort = \"[{field: 'Name', direction: 'asc'}]\"\n// after\nsort = \"[{\\\"field\\\":\\\"Name\\\",\\\"direction\\\":\\\"asc\\\"}]\"","handlingStrategy":"validation","validationCode":"// Validate sort JSON before submitting\ntry { new com.fasterxml.jackson.databind.ObjectMapper().readValue(sortJson, new TypeReference<List<Map<String,Object>>>(){}); } catch (Exception e) { throw new IllegalArgumentException(\"bad sort\"); }","typeGuard":null,"tryCatchPattern":"try { createSource(config); } catch (IllegalArgumentException e) { /* message contains the offending sort string */ }","preventionTips":["Quote all keys and string values in the sort JSON","Test the JSON with a linter or jq before pasting into HOCON","Keep Airtable's sort shape: array of {field, direction} objects"],"tags":["json","config","airtable","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}