{"record":{"id":"9c62d2709c642757","repo":"alibaba/nacos","slug":"20002-9c62d2","errorCode":"20002","errorMessage":"Request parameter `endpointSource` contains an invalid value.","messagePattern":"Request parameter `endpointSource` contains an invalid value\\.","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agent/client/AgentDiscoveryForm.java","lineNumber":121,"sourceCode":"        result.setProtocolVersion(protocolVersion);\n        result.setTransports(transport);\n        result.setEndpointSources(parseEndpointSources());\n        result.setMetadataSelector(selector);\n        return result;\n    }\n    \n    private List<EndpointSource> parseEndpointSources() throws NacosApiException {\n        if (endpointSource == null) {\n            return null;\n        }\n        List<EndpointSource> result = new ArrayList<EndpointSource>(endpointSource.size());\n        try {\n            for (String source : endpointSource) {\n                result.add(EndpointSource.valueOf(source));\n            }\n            return result;\n        } catch (IllegalArgumentException | NullPointerException e) {\n            throw new NacosApiException(NacosException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Request parameter `endpointSource` contains an invalid value.\");\n        }\n    }\n    \n    public String getNamespaceId() {\n        return namespaceId;\n    }\n    \n    public void setNamespaceId(String namespaceId) {\n        this.namespaceId = namespaceId;\n    }\n    \n    public String getAgentName() {\n        return agentName;\n    }\n    \n    public void setAgentName(String agentName) {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agent/client/AgentDiscoveryForm.java#L103-L139","documentation":"Thrown by AgentValidationUtils.validateNonNullJsonValue when a required JSON-compatible field deserialized to Java null. After request binding, a JSON null (explicit null) and an absent field both yield a Java null reference; this guard rejects it for fields the schema marks required. The dynamic fieldName names the offending property.","triggerScenarios":"Submitting a call interface (RadModelValidator.validateCallInterface line 343) whose nativeDescriptor is JSON null or absent. Any caller using validateNonNullJsonValue on a required object field hits this when the client sends null.","commonSituations":"Distinguishing 'unset' from 'null' in JSON — a client sending {\"nativeDescriptor\": null} or omitting the key both deserialize to null; schema drift where a field became required but clients still omit it.","solutions":["Provide a concrete JSON value for the required field (object, array, or scalar) instead of null.","Make your client schema explicit so required fields are always populated.","If the field is genuinely optional on your side, do not route it through validateNonNullJsonValue."],"exampleFix":"// before\n{ \"nativeDescriptor\": null }\n// after\n{ \"nativeDescriptor\": { \"openrpc\": \"1.2.0\" } }","handlingStrategy":"type-guard","validationCode":"if (value == null) {\n    throw new IllegalArgumentException(fieldName + \" must not be JSON null\");\n}","typeGuard":"static boolean isPresentJsonValue(Object v) {\n    return v != null;\n}","tryCatchPattern":"try {\n    AgentValidationUtils.validateNonNullJsonValue(value, fieldName);\n} catch (IllegalArgumentException e) {\n    // return 400, required field missing\n}","preventionTips":["Populate required JSON fields explicitly; avoid sending null.","Distinguish absent vs null in client serialization."],"tags":["ai-agent","validation","json","required-field","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}