{"record":{"id":"3aeb275e3e8239ee","repo":"alibaba/spring-ai-alibaba","slug":"param-not-support-object","errorCode":null,"errorMessage":"Param Not Support Object","messagePattern":"Param Not Support 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":120,"sourceCode":"\t * Converts OpenAPI parameters to YAML parameters\n\t * @param parameters List of OpenAPI parameters\n\t * @param inputYamlParamList List to store converted parameters\n\t */\n\tprivate static void paramToYamlParam(List<Parameter> parameters, List<ApiParameter> inputYamlParamList) {\n\t\tif (parameters == null) {\n\t\t\treturn;\n\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}","sourceCodeStart":102,"sourceCodeEnd":138,"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#L102-L138","documentation":"OpenApiUtils.paramToYamlParam() converts OpenAPI parameter schemas into tool form parameters; nested object-typed parameters are not representable in the flat YAML parameter model, so it throws RuntimeException(\"Param Not Support Object\").","triggerScenarios":"Importing an OpenAPI spec whose operation has a query/header/path parameter whose schema type is 'object' (e.g. a free-form object parameter or JSON-valued parameter).","commonSituations":"Importing third-party APIs that use object-typed query params (common with JSON-in-query style APIs like some Google/Elasticsearch APIs); hand-written specs with nested parameter schemas.","solutions":["Refactor the API spec so the parameter is a primitive (string/integer) or move the object into the request body (body objects are supported)","Pre-process the OpenAPI document to flatten or serialize object params to a string type before import","Serialize the object param manually, e.g. type: string with a JSON-encoded example, in the spec"],"exampleFix":"// before (OpenAPI)\nparameters:\n  - name: filter\n    in: query\n    schema: {type: object}\n// after\nparameters:\n  - name: filter\n    in: query\n    schema: {type: string}\n    description: JSON-encoded filter object","handlingStrategy":"validation","validationCode":"for (Parameter p : operation.getParameters()) {\n    if (p.getSchema() != null && \"object\".equals(p.getSchema().getType())) {\n        throw new IllegalArgumentException(\"Param '\" + p.getName() + \"' must not be object type\");\n    }\n}","typeGuard":"static boolean isObjectParam(Schema<?> s) { return s != null && \"object\".equals(s.getType()); }","tryCatchPattern":"try {\n    OpenApiUtils.parseSchemaToForm(openApiDoc);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Param Not Support\")) {\n        // reject/flatten spec before import\n    }\n}","preventionTips":["Lint specs for object-typed parameters before import","Encode JSON params as strings with documentation","Prefer request bodies for structured data"],"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"}