{"record":{"id":"66bb74bf003d4c94","repo":"apache/seatunnel","slug":"parent-path-must-contain-for-arrayjsonpathproc","errorCode":null,"errorMessage":"Parent path must contain [*] for ArrayJsonPathProcessor","messagePattern":"Parent path must contain \\[\\*\\] for ArrayJsonPathProcessor","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/util/ArrayJsonPathProcessor.java","lineNumber":81,"sourceCode":"                        String.format(\n                                \"Paths have different array parents. Expected '%s' but found path starting with '%s'\",\n                                parentPath, pathStrings[i]));\n            }\n        }\n\n        return parentPath;\n    }\n\n    /**\n     * Get a relative path based on a parent path and a full path.\n     *\n     * @param parentPath The parent path\n     * @param fullPath The complete path\n     * @return The relative path from parent to full path\n     */\n    private String getRelativePath(String parentPath, String fullPath) {\n        if (!parentPath.contains(\"[*]\")) {\n            throw new IllegalArgumentException(\n                    \"Parent path must contain [*] for ArrayJsonPathProcessor\");\n        }\n\n        if (!fullPath.contains(\"[*]\")) {\n            // For non-array paths when parent has [*], extract the correct relative part\n            String commonPart = parentPath.substring(0, parentPath.indexOf(\"[*]\"));\n            String relativePart = fullPath.substring(commonPart.length());\n\n            // If the relative part starts with a dot, remove it\n            if (relativePart.startsWith(\".\")) {\n                relativePart = relativePart.substring(1);\n            }\n\n            return \"$.\" + relativePart;\n        } else {\n            // Original implementation for array paths\n            String relativePart = fullPath.substring(parentPath.length());\n","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/util/ArrayJsonPathProcessor.java#L63-L99","documentation":"ArrayJsonPathProcessor.getRelativePath requires the computed parent path to contain the [*] wildcard; otherwise the relative-path logic is meaningless and an IllegalArgumentException is thrown. This indicates the common parent extraction produced a non-array path.","triggerScenarios":"Calling ArrayJsonPathProcessor with paths whose extracted common parent lacks [*] — i.e. the JsonPaths do not point into arrays (e.g. $.data.field instead of $.data.items[*].field).","commonSituations":"Misconfigured json_field paths without array wildcards routed into the array processor; a regression in extractCommonParentPath returning a plain prefix.","solutions":["Add [*] to the array segment of your json_field paths (e.g. $.data.items[*].id)","Use the default (non-array) JsonPathProcessor for flat paths without arrays","Report/inspect extractCommonParentPath if the input clearly contains [*] but the error still fires"],"exampleFix":"// before\njson_field = { path = [\"$.data.id\", \"$.data.name\"] }\n// after\njson_field = { path = [\"$.data.items[*].id\", \"$.data.items[*].name\"] }","handlingStrategy":"validation","validationCode":"if (!parentPath.contains(\"[*]\")) { throw new IllegalArgumentException(\"Array processor requires paths with [*]\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only route paths containing [*] to ArrayJsonPathProcessor","Include the array wildcard in every json_field path used with array mode","Add unit tests covering parent-path extraction for your path shapes"],"tags":["jsonpath","array","config"],"backgroundTag":"invalid-argument-value","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"}