{"record":{"id":"2a0ebecf4c4a62ec","repo":"alibaba/nacos","slug":"parameter-missing-2a0ebe","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'serviceName' type String is not present","messagePattern":"Required parameter 'serviceName' type String is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"naming/src/main/java/com/alibaba/nacos/naming/model/form/ClientServiceForm.java","lineNumber":52,"sourceCode":"    \n    @Serial\n    private static final long serialVersionUID = 7382718107541271520L;\n    \n    private String namespaceId;\n    \n    private String groupName;\n    \n    private String serviceName;\n    \n    private String ip;\n    \n    private Integer port;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultValue();\n        if (StringUtils.isBlank(serviceName)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(), ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'serviceName' type String is not present\");\n        }\n    }\n    \n    /**\n     * fill default value.\n     */\n    public void fillDefaultValue() {\n        if (StringUtils.isBlank(namespaceId)) {\n            namespaceId = Constants.DEFAULT_NAMESPACE_ID;\n        }\n        if (StringUtils.isBlank(groupName)) {\n            groupName = Constants.DEFAULT_GROUP;\n        }\n    }\n    \n    public String getNamespaceId() {\n        return namespaceId;","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/naming/src/main/java/com/alibaba/nacos/naming/model/form/ClientServiceForm.java#L34-L70","documentation":"Thrown by ClientServiceForm.validate() when the 'serviceName' field is blank (null, empty, or whitespace-only). This form backs client-facing service query APIs. The error carries ErrorCode.PARAMETER_MISSING with HTTP 400.","triggerScenarios":"Calling a client-facing naming API (e.g. GET /v3/client/ns/service) without providing the serviceName query parameter, or passing serviceName='' or serviceName='   '.","commonSituations":"Forgetting the serviceName parameter in the request URL, or a client SDK not populating it before the call.","solutions":["Provide a non-blank serviceName in the request.","Ensure the client SDK sets serviceName before calling the API."],"exampleFix":"// before\nGET /v3/client/ns/service?namespaceId=public&groupName=DEFAULT_GROUP\n// after\nGET /v3/client/ns/service?namespaceId=public&groupName=DEFAULT_GROUP&serviceName=my-service","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(serviceName)) {\n    throw new IllegalArgumentException(\"serviceName is required\");\n}","typeGuard":"function hasServiceName(form: { serviceName?: string }): boolean {\n  return typeof form.serviceName === 'string' && form.serviceName.trim().length > 0;\n}","tryCatchPattern":"// HTTP 400 — validate on the client side before sending\nif (!hasServiceName(form)) {\n  return Promise.reject(new Error('serviceName is required'));\n}","preventionTips":["Always populate serviceName in the form/SDK before the call.","Add a pre-flight check in your client wrapper."],"tags":["naming","validation","parameter-missing","service"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}