{"record":{"id":"da7721af6986811a","repo":"iflytek/astron-agent","slug":"parameter-error-da7721","errorCode":"PARAMETER_ERROR","errorMessage":"PARAMETER_ERROR","messagePattern":"PARAMETER_ERROR","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowSkillExportServiceImpl.java","lineNumber":54,"sourceCode":"@Slf4j\n@Service\n@RequiredArgsConstructor\npublic class WorkflowSkillExportServiceImpl implements WorkflowSkillExportService {\n\n    private static final int METADATA_GENERATION_TIMEOUT_SECONDS = 8;\n    private static final int SKILL_NAME_MAX_LENGTH = 64;\n    private static final int SKILL_DESCRIPTION_MAX_LENGTH = 1024;\n    private static final String SKILL_FILE_NAME = \"SKILL.md\";\n\n    private final WorkflowService workflowService;\n    private final PublishApiService publishApiService;\n    private final OpenAiModelProcessService openAiModelProcessService;\n    private final DataPermissionCheckTool dataPermissionCheckTool;\n\n    @Override\n    public WorkflowSkillExportResponse exportSkill(WorkflowSkillExportRequest request) {\n        if (request == null || request.getBotId() == null || request.getWorkflowId() == null) {\n            throw new BusinessException(ResponseEnum.PARAMETER_ERROR);\n        }\n\n        Workflow workflow = workflowService.getById(request.getWorkflowId());\n        if (workflow == null) {\n            throw new BusinessException(ResponseEnum.BOT_NOT_EXIST);\n        }\n        dataPermissionCheckTool.checkWorkflowBelong(workflow, SpaceInfoUtil.getSpaceId());\n\n        String workflowName = StringUtils.defaultIfBlank(request.getWorkflowName(), workflow.getName());\n        String workflowDescription =\n                StringUtils.defaultIfBlank(request.getWorkflowDescription(), workflow.getDescription());\n        if (StringUtils.isBlank(workflowName) || StringUtils.isBlank(workflowDescription)) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_SKILL_NAME_DESC_EMPTY);\n        }\n\n        BotApiInfoDTO apiInfo = publishApiService.getApiInfo(request.getBotId());\n        if (!hasPublishedApi(apiInfo)) {\n            throw new BusinessException(ResponseEnum.WORKFLOW_SKILL_API_NOT_READY);","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowSkillExportServiceImpl.java#L36-L72","documentation":"exportSkill rejects the request upfront with PARAMETER_ERROR when the request body or its mandatory identifiers are missing. exportSkill requires both botId and workflowId to locate the bot's published API and the workflow definition.","triggerScenarios":"POSTing to the workflow-skill export endpoint with a null body, or a body where botId or workflowId is null/absent — e.g. an empty JSON payload {} or a client that only sends workflowName/description.","commonSituations":"Frontend form submitted before the workflow/bot was selected; API consumer omitting required fields; serialization dropping null fields and the server then seeing them as absent.","solutions":["Include both botId and workflowId in the request payload and resend.","Validate the client form so the export button is disabled until a bot and workflow are selected.","Check the HTTP layer isn't stripping the body (wrong content-type, e.g. missing application/json).","Add client-side required-field validation mirroring the server check."],"exampleFix":"// before\nPOST /workflow/skill/export\n{}\n// after\nPOST /workflow/skill/export\n{\"botId\": 123, \"workflowId\": 456}","handlingStrategy":"validation","validationCode":"if (request == null || request.getBotId() == null || request.getWorkflowId() == null) {\n    throw new IllegalArgumentException(\"botId and workflowId are required for skill export\");\n}","typeGuard":"boolean isValidSkillExportRequest(WorkflowSkillExportRequest r) {\n    return r != null && r.getBotId() != null && r.getWorkflowId() != null;\n}","tryCatchPattern":"try {\n    return exportSkill(request);\n} catch (BusinessException e) {\n    if (\"PARAMETER_ERROR\".equals(e.getCode())) {\n        return badRequest(\"botId and workflowId must be provided\");\n    }\n    throw e;\n}","preventionTips":["Disable the export action until bot and workflow are selected in the UI","Always send Content-Type: application/json with a non-empty body","Mirror required-field checks client-side before calling the API"],"tags":["request-validation","missing-parameter","java","api"],"backgroundTag":"missing-required-argument","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}