alibaba/spring-ai-alibaba · error · BizException

MISSING_PARAMS

MISSING_PARAMS

Error message

workspace

What it means

createWorkspace requires a deserialized Workspace body; if the @RequestBody is null (empty or unparseable payload) the controller throws MISSING_PARAMS naming 'workspace'. This fails fast before the service layer is invoked.

Source

Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/WorkspaceController.java:61

	/** Service for workspace operations */
	private final WorkspaceService workspaceService;

	public WorkspaceController(WorkspaceService workspaceService) {
		this.workspaceService = workspaceService;
	}

	/**
	 * Creates a new workspace
	 * @param workspace Workspace information
	 * @return Result containing the created workspace ID
	 */
	@PostMapping()
	public Result<String> createWorkspace(@RequestBody Workspace workspace) {
		RequestContext context = RequestContextHolder.getRequestContext();

		if (Objects.isNull(workspace)) {
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("workspace"));
		}

		if (StringUtils.isBlank(workspace.getName())) {
			throw new BizException(ErrorCode.MISSING_PARAMS.toError("name"));
		}

		String workspaceId = workspaceService.createWorkspace(workspace);
		return Result.success(context.getRequestId(), workspaceId);
	}

	/**
	 * Updates an existing workspace
	 * @param workspaceId ID of the workspace to update
	 * @param workspace Updated workspace information
	 * @return Result indicating success
	 */
	@PutMapping("/{workspaceId}")
	public Result<String> updateWorkspace(@PathVariable("workspaceId") String workspaceId,

View on GitHub (pinned to f82da0b50f)

Solutions

  1. Send a JSON body representing the workspace, e.g. {"name":"my-workspace"}
  2. Set Content-Type: application/json on the request
  3. Verify the Workspace field names match the API model
  4. Check client serialization code for accidental empty-body sends

Example fix

// before
curl -X POST http://host/workspace
// after
curl -X POST http://host/workspace -H 'Content-Type: application/json' -d '{"name":"my-workspace"}'
Defensive patterns

Strategy: validation

Validate before calling

function canCreateWorkspace(input) {
  return typeof input === 'object' && input !== null
    && typeof input.name === 'string' && input.name.trim().length > 0;
}
if (!canCreateWorkspace(payload)) throw new Error('workspace body with name is required');

Type guard

function isWorkspace(v) {
  return typeof v === 'object' && v !== null && typeof v.name === 'string';
}

Try / catch

try {
  await api.post('/workspace', workspace);
} catch (e) {
  if (e.response?.data?.code === 'MISSING_PARAMS') {
    showToast('Workspace payload is required');
  } else throw e;
}

Prevention

When it happens

Trigger: POST /workspace (or its base mapping) with no body or a body that does not deserialize into Workspace.

Common situations: Calling the create endpoint with an empty POST, wrong Content-Type (e.g. text/plain), or a JSON key typo causing a null object in manual clients.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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