alibaba/spring-ai-alibaba · error · RuntimeException

Param Not Support Array<Object>

Error message

Param Not Support Array<Object>

What it means

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>").

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/utils/api/OpenApiUtils.java:127

		}

		parameters.forEach(item -> {
			ApiParameter paramInfo = new ApiParameter();
			paramInfo.setKey(item.getName());
			paramInfo.setRequired(item.getRequired() != null && item.getRequired());
			paramInfo.setDescription(item.getDescription());
			Schema schema = item.getSchema();
			String type = schema.getType();

			if ("object".equals(type)) {
				throw new RuntimeException("Param Not Support Object");
			}

			if ("array".equals(type)) {
				Schema schemaItem = schema.getItems();
				String itemType = schemaItem.getType();
				if ("object".equals(itemType)) {
					throw new RuntimeException("Param Not Support Array<Object>");
				}
				paramInfo.setType("Array<" + firstLetterToUpperCase(type) + ">");
			}
			else {
				paramInfo.setType(firstLetterToUpperCase(type));
			}

			paramInfo.setLocation(firstLetterToUpperCase(item.getIn()));
			if (schema.getDefault() != null) {
				paramInfo.setDefaultValue(schema.getDefault().toString());
			}

			// if need to pass extended info
			if (schema.getExtensions() != null) {
				Object paramSource = schema.getExtensions().get(DEFINED_EXTENSION);
				if (paramSource instanceof String && String.valueOf(paramSource).equals(EXTENSION_USER_SOURCE)) {
					paramInfo.setUserInput(true);
				}

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Change the parameter to array of primitives or move it into the request body where object arrays are supported
  2. Pre-process the spec: replace items type object with string and document JSON encoding per element
  3. Use POST with a requestBody instead of a parameter list for structured payloads

Example fix

// before
schema:
  type: array
  items: {type: object}
// after
requestBody:
  content:
    application/json:
      schema:
        type: array
        items: {type: object}
Defensive patterns

Strategy: validation

Validate before calling

for (Parameter p : operation.getParameters()) {
    Schema<?> s = p.getSchema();
    if (s != null && "array".equals(s.getType())
        && s.getItems() != null && "object".equals(s.getItems().getType())) {
        throw new IllegalArgumentException("Param '" + p.getName() + "' must not be Array<Object>");
    }
}

Type guard

static boolean isArrayObjectParam(Schema<?> s) {
    return s != null && "array".equals(s.getType())
        && s.getItems() != null && "object".equals(s.getItems().getType());
}

Try / catch

try {
    OpenApiUtils.parseSchemaToForm(spec);
} catch (RuntimeException e) {
    if (e.getMessage().contains("Array<Object>")) {
        // move parameter to requestBody and retry
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09). Data as JSON: /api/errors/fab9506dccf5b1db. Report an issue: GitHub.