{"record":{"id":"2d9e619e053cc8b1","repo":"alibaba/nacos","slug":"invalid-descriptormediatype-mediatype","errorCode":null,"errorMessage":"Invalid descriptorMediaType: {mediaType}","messagePattern":"Invalid descriptorMediaType: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java","lineNumber":213,"sourceCode":"     * @param contentDigest content digest\n     * @throws IllegalArgumentException when invalid\n     */\n    public static void validateContentDigest(String contentDigest) {\n        if (contentDigest == null || !CONTENT_DIGEST_PATTERN.matcher(contentDigest).matches()) {\n            throw new IllegalArgumentException(\"Invalid contentDigest: \" + contentDigest);\n        }\n    }\n    \n    /**\n     * Validate a descriptor media type.\n     *\n     * @param mediaType media type\n     * @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.","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java#L195-L231","documentation":"Error \"Invalid descriptorMediaType: {mediaType}\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at api/src/main/java/com/alibaba/nacos/api/ai/utils/AgentValidationUtils.java:213 when the library encounters an invalid state.","commonSituations":"Validating a storage descriptor with an unsupported media type.","solutions":["Correct the invalid value for descriptorMediaType validation to match the expected format or allowed set, then 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"}