{"record":{"id":"dbf066661ae2337c","repo":"alibaba/spring-ai-alibaba","slug":"missing-params-dbf066","errorCode":"MISSING_PARAMS","errorMessage":"Required parameters [type] missing, please check the request parameters.","messagePattern":"Required parameters \\[type\\] missing, please check the request parameters\\.","errorType":"error_code","errorClass":"BizException","httpStatus":400,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java","lineNumber":129,"sourceCode":"\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new BizException(ErrorCode.APP_COMPONENT_LIST_ERROR.toError());\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves a paginated list of applications that can be published as components.\n\t * This endpoint filters out applications that are already published as components.\n\t * @param request Query parameters including: - type: Application type - appName:\n\t * Application name\n\t * @return Result containing a PagingList of Application objects that can be published\n\t * as components\n\t */\n\t@GetMapping(\"/app-publishable\")\n\tpublic Result<PagingList<Application>> getAppPublishablePageList(@ApiModelAttribute AppComponentQuery request) {\n\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\tif (Objects.isNull(request.getType())) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"type\"));\n\t\t}\n\n\t\t// component published\n\t\tList<AppComponent> appComponentList = appComponentService.getAppComponentListAll(request.getType(),\n\t\t\t\tAppComponentStatusEnum.Published.getCode());\n\t\tList<String> codes = new ArrayList<>();\n\t\tif (appComponentList != null && !appComponentList.isEmpty()) {\n\t\t\tcodes = appComponentList.stream().map(AppComponent::getAppId).collect(Collectors.toList());\n\t\t}\n\t\t// application can released to component\n\t\tList<Long> ids = appService.getApplicationPublished(request.getType(), request.getAppName(), codes);\n\n\t\tPagingList<Application> componentList = appService.getApplicationPublishedAndNotComponentList(request, codes,\n\t\t\t\tids);\n\t\treturn Result.success(context.getRequestId(), componentList);\n\t}\n\n\t/**","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/AppComponentController.java#L111-L147","documentation":"getAppPublishablePageList requires the 'type' field on the AppComponentQuery request. If request.getType() is null the controller aborts with MISSING_PARAMS before querying. 'type' distinguishes which kind of component is being queried.","triggerScenarios":"GET /appComponent/app-publishable without a 'type' query parameter (or with type explicitly bound as null), e.g. ?pageNum=1&pageSize=10 with no type.","commonSituations":"Frontend omits the component-type selector default value; older clients predating the type field; copied URL missing the type param.","solutions":["Add the type parameter to the request, e.g. ?type=plugin (or whatever AppComponentType the client intends).","Update the frontend to always send type when calling /app-publishable.","Check AppComponentQuery binding — ensure the param name matches the field name expected by @ApiModelAttribute."],"exampleFix":"// before\nGET /appComponent/app-publishable?pageNum=1&pageSize=10\n// after\nGET /appComponent/app-publishable?pageNum=1&pageSize=10&type=PLUGIN","handlingStrategy":"validation","validationCode":"if (!query.type) throw new Error('type is required for /appComponent/app-publishable');","typeGuard":"function hasType(q) { return q != null && typeof q.type === 'string' && q.type.length > 0; }","tryCatchPattern":"try {\n  const page = await api.getAppPublishable(query);\n} catch (e) {\n  if (e.code === 'MISSING_PARAMS' && /type/.test(e.message)) {\n    // prompt user to select a component type\n  } else throw e;\n}","preventionTips":["Default the component-type selector in the UI so type is always sent.","Validate query params in the client before issuing the request.","Document required query params on the endpoint."],"tags":["http","missing-parameter","validation"],"backgroundTag":"missing-required-argument","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"}