{"record":{"id":"fab9506dccf5b1db","repo":"alibaba/spring-ai-alibaba","slug":"param-not-support-array-object","errorCode":null,"errorMessage":"Param Not Support Array<Object>","messagePattern":"Param Not Support Array<Object>","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/utils/api/OpenApiUtils.java","lineNumber":127,"sourceCode":"\t\t}\n\n\t\tparameters.forEach(item -> {\n\t\t\tApiParameter paramInfo = new ApiParameter();\n\t\t\tparamInfo.setKey(item.getName());\n\t\t\tparamInfo.setRequired(item.getRequired() != null && item.getRequired());\n\t\t\tparamInfo.setDescription(item.getDescription());\n\t\t\tSchema schema = item.getSchema();\n\t\t\tString type = schema.getType();\n\n\t\t\tif (\"object\".equals(type)) {\n\t\t\t\tthrow new RuntimeException(\"Param Not Support Object\");\n\t\t\t}\n\n\t\t\tif (\"array\".equals(type)) {\n\t\t\t\tSchema schemaItem = schema.getItems();\n\t\t\t\tString itemType = schemaItem.getType();\n\t\t\t\tif (\"object\".equals(itemType)) {\n\t\t\t\t\tthrow new RuntimeException(\"Param Not Support Array<Object>\");\n\t\t\t\t}\n\t\t\t\tparamInfo.setType(\"Array<\" + firstLetterToUpperCase(type) + \">\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tparamInfo.setType(firstLetterToUpperCase(type));\n\t\t\t}\n\n\t\t\tparamInfo.setLocation(firstLetterToUpperCase(item.getIn()));\n\t\t\tif (schema.getDefault() != null) {\n\t\t\t\tparamInfo.setDefaultValue(schema.getDefault().toString());\n\t\t\t}\n\n\t\t\t// if need to pass extended info\n\t\t\tif (schema.getExtensions() != null) {\n\t\t\t\tObject paramSource = schema.getExtensions().get(DEFINED_EXTENSION);\n\t\t\t\tif (paramSource instanceof String && String.valueOf(paramSource).equals(EXTENSION_USER_SOURCE)) {\n\t\t\t\t\tparamInfo.setUserInput(true);\n\t\t\t\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/utils/api/OpenApiUtils.java#L109-L145","documentation":"In paramToYamlParam(), array-typed parameters are allowed only if their items are primitives; if the array's items schema is type 'object', the flat parameter model cannot represent Array<Object>, so it throws RuntimeException(\"Param Not Support Array<Object>\").","triggerScenarios":"Importing an OpenAPI spec where a parameter has schema {type: array, items: {type: object}} — e.g. an array of JSON objects passed as a query parameter.","commonSituations":"Batch APIs that accept arrays of objects in query params; auto-generated specs from frameworks that expose complex list parameters; Swagger files written for non-HTTP-form consumption.","solutions":["Change the parameter to array of primitives or move it into the request body where object arrays are supported","Pre-process the spec: replace items type object with string and document JSON encoding per element","Use POST with a requestBody instead of a parameter list for structured payloads"],"exampleFix":"// before\nschema:\n  type: array\n  items: {type: object}\n// after\nrequestBody:\n  content:\n    application/json:\n      schema:\n        type: array\n        items: {type: object}","handlingStrategy":"validation","validationCode":"for (Parameter p : operation.getParameters()) {\n    Schema<?> s = p.getSchema();\n    if (s != null && \"array\".equals(s.getType())\n        && s.getItems() != null && \"object\".equals(s.getItems().getType())) {\n        throw new IllegalArgumentException(\"Param '\" + p.getName() + \"' must not be Array<Object>\");\n    }\n}","typeGuard":"static boolean isArrayObjectParam(Schema<?> s) {\n    return s != null && \"array\".equals(s.getType())\n        && s.getItems() != null && \"object\".equals(s.getItems().getType());\n}","tryCatchPattern":"try {\n    OpenApiUtils.parseSchemaToForm(spec);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Array<Object>\")) {\n        // move parameter to requestBody and retry\n    }\n}","preventionTips":["Reject Array<Object> params in spec CI linting","Design batch APIs around POST bodies","Document JSON-encoding workarounds for callers"],"tags":["openapi","import","validation","java"],"backgroundTag":"unsupported-operation","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}