{"record":{"id":"5967e7b1ebff01c7","repo":"Tencent/APIJSON","slug":"request-allow-partial-update-fail-value-k-5967e7","errorCode":null,"errorMessage":"后端 Request 表中 ALLOW_PARTIAL_UPDATE_FAIL:value 中 {key} 对应的 {key}:[] 不存在！","messagePattern":"后端 Request 表中 ALLOW_PARTIAL_UPDATE_FAIL:value 中 (.+?) 对应的 (.+?):\\[\\] 不存在！","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java","lineNumber":1235,"sourceCode":"\t\t\tMap<String,Object> map = new HashMap<>();\n\t\t\tfor (String u : uniques) {\n\t\t\t\tmap.put(u, real.get(u));\n\t\t\t}\n\t\t\tverifyRepeat(name, map, exceptId, finalIdKey, parser);\n\t\t}\n\t\t// 校验重复>>>>>>>>>>>>>>>>>>>\n\n\t\t// 校验并配置允许批量增删改部分失败<<<<<<<<<<<<<<<<<<<\n\t\tString allowPartialUpdateFail = StringUtil.get(getString(target, ALLOW_PARTIAL_UPDATE_FAIL.name()));\n\t\tString[] partialFails = StringUtil.split(allowPartialUpdateFail);\n\t\tif (partialFails != null && partialFails.length > 0) {\n\t\t\tfor (String key : partialFails) {\n                if (isArrayKey(key) == false) {\n                    throw new IllegalArgumentException(\"后端 Request 表中 \" + ALLOW_PARTIAL_UPDATE_FAIL.name()\n                            + \":value 中 \" + key + \" 不合法！必须以 [] 结尾！\");\n                }\n                if (target.get(key) instanceof Collection == false) {\n                    throw new IllegalArgumentException(\"后端 Request 表中 \" + ALLOW_PARTIAL_UPDATE_FAIL.name()\n                            + \":value 中 \" + key + \" 对应的 \" + key + \":[] 不存在！\");\n                }\n\n                // 可能 Table[] 和 Table:alias[] 冲突  int index = key.indexOf(\":\");\n                // String k = index < 0 ? key.substring(0, key.length() - 2) : key.substring(0, index);\n                String k = key.substring(0, key.length() - 2);\n                if (k.isEmpty()) {\n                    throw new IllegalArgumentException(\"后端 Request 表中 \" + ALLOW_PARTIAL_UPDATE_FAIL.name()\n                            + \":value 中 \" + key + \" 不合法！[] 前必须有名字！\");\n                }\n\n\t\t\t\tAbstractSQLConfig.ALLOW_PARTIAL_UPDATE_FAIL_TABLE_MAP.putIfAbsent(k, \"\");\n\t\t\t}\n\t\t}\n\t\t// 校验并配置允许部分批量增删改失败>>>>>>>>>>>>>>>>>>>\n\n\n\t\tString[] nks = ifObj == null ? null : StringUtil.split(getString(real, KEY_NULL));","sourceCodeStart":1217,"sourceCodeEnd":1253,"githubUrl":"https://github.com/Tencent/APIJSON/blob/5284052872898eddc449a58f629e5c8d588b8e22/APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java#L1217-L1253","documentation":"Each token in ALLOW_PARTIAL_UPDATE_FAIL must not only end with '[]' but also refer to an existing array key in the same Request-table structure object (target.get(key) must be a Collection). This error fires when the config lists e.g. 'User[]' but the structure has no 'User[]':[] entry at all, so there is nothing for partial-failure to apply to — a config inconsistency, not a client mistake.","triggerScenarios":"Request table structure contains ALLOW_PARTIAL_UPDATE_FAIL:\"Comment[]\" while the same object has no \"Comment\":[] / \"Comment[]\":[] key (target.get(\"Comment[]\") is null or not a Collection). The exception is thrown during AbstractVerifier.parse of that structure on the next matching request.","commonSituations":"Renaming a table in the structure but forgetting to update ALLOW_PARTIAL_UPDATE_FAIL; hand-merging two Request rows; deleting a batch key from structure but leaving its name in ALLOW_PARTIAL_UPDATE_FAIL; typo in the table name inside the allow-list.","solutions":["Add the matching array key to the structure, e.g. include \"User[]\":[] in the same Request object, or","Remove the stale token from ALLOW_PARTIAL_UPDATE_FAIL so the list only contains keys that exist as arrays in that structure.","Check exact spelling/case: keys are case-sensitive, 'user[]' will not match 'User[]'."],"exampleFix":"// before\n{\"ALLOW_PARTIAL_UPDATE_FAIL\":\"Comment[]\",\"Moment[]\":[]}\n// after\n{\"ALLOW_PARTIAL_UPDATE_FAIL\":\"Moment[]\",\"Moment[]\":[]}","handlingStrategy":"validation","validationCode":"void checkPartialFailTargets(JSONObject structure) {\n  String[] toks = StringUtil.split(StringUtil.get(structure.getString(\"ALLOW_PARTIAL_UPDATE_FAIL\")));\n  if (toks == null) return;\n  for (String t : toks)\n    if (!(structure.get(t) instanceof Collection))\n      throw new IllegalStateException(t + \" listed in ALLOW_PARTIAL_UPDATE_FAIL but \" + t + \":[] missing in structure\");\n}","typeGuard":null,"tryCatchPattern":"try { verifier.parse(...); }\ncatch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\":[] 不存在\")) {\n    // reconcile structure vs allow-list, then re-deploy\n  }\n  throw e;\n}","preventionTips":["Treat ALLOW_PARTIAL_UPDATE_FAIL and the structure's array keys as one unit — validate them together in a config lint step.","Re-run the lint after any table rename or structure merge."],"tags":["apijson","server-config","request-table","config-consistency"],"backgroundTag":null,"analyzedSha":"5284052872898eddc449a58f629e5c8d588b8e22","analyzedAt":"2026-08-14T15:15:29.577Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}