{"record":{"id":"1af30846f11517a8","repo":"alibaba/nacos","slug":"fieldname-must-not-be-json-null","errorCode":null,"errorMessage":"{fieldName} must not be JSON null","messagePattern":"(.+?) must not be JSON null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java","lineNumber":226,"sourceCode":"     * @throws IllegalArgumentException when invalid\n     */\n    public static void validateMediaType(String mediaType) {\n        if (mediaType == null || mediaType.length() > MAX_MEDIA_TYPE_LENGTH\n            || !MEDIA_TYPE_PATTERN.matcher(mediaType).matches()) {\n            throw new IllegalArgumentException(\"Invalid descriptorMediaType: \" + mediaType);\n        }\n    }\n    \n    /**\n     * Validate a required JSON-compatible value after request binding.\n     *\n     * @param value JSON-compatible value\n     * @param fieldName field name used in validation errors\n     * @throws IllegalArgumentException when the value is {@code null}\n     */\n    public static void validateNonNullJsonValue(Object value, String fieldName) {\n        if (value == null) {\n            throw new IllegalArgumentException(fieldName + \" must not be JSON null\");\n        }\n    }\n    \n    /**\n     * Validate optional public Endpoint metadata.\n     *\n     * @param metadata Endpoint metadata, or {@code null}\n     * @throws IllegalArgumentException when invalid or using a reserved key\n     */\n    public static void validateEndpointMetadata(Map<String, String> metadata) {\n        if (metadata == null) {\n            return;\n        }\n        if (metadata.size() > MAX_METADATA_SIZE) {\n            throw new IllegalArgumentException(\n                \"Endpoint metadata exceeds \" + MAX_METADATA_SIZE + \" entries\");\n        }\n        for (Map.Entry<String, String> entry : metadata.entrySet()) {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java#L208-L244","documentation":"Error \"{fieldName} must not be JSON null\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java:226 when the library encounters an invalid state.","commonSituations":"A field was explicitly set to JSON null where a real value is required.","solutions":["Review the input and runtime state for JSON null field, correct the reported problem, and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}