From 06669534cd7c6cf0eaf241a416dae206b67b894b Mon Sep 17 00:00:00 2001 From: yusing Date: Sun, 17 Aug 2025 01:49:49 +0800 Subject: [PATCH] fix(api): validate API response --- internal/api/v1/file/validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/v1/file/validate.go b/internal/api/v1/file/validate.go index 4735b8b8..b0eade7f 100644 --- a/internal/api/v1/file/validate.go +++ b/internal/api/v1/file/validate.go @@ -27,7 +27,7 @@ type ValidateFileRequest struct { // @Success 200 {object} apitypes.SuccessResponse "File validated" // @Failure 400 {object} apitypes.ErrorResponse "Bad request" // @Failure 403 {object} apitypes.ErrorResponse "Forbidden" -// @Failure 417 {object} apitypes.ErrorResponse "Validation failed" +// @Failure 417 {object} any "Validation failed" // @Failure 500 {object} apitypes.ErrorResponse "Internal server error" // @Router /file/validate [post] func Validate(c *gin.Context) { @@ -45,7 +45,7 @@ func Validate(c *gin.Context) { c.Request.Body.Close() if valErr := validateFile(request.FileType, content); valErr != nil { - c.JSON(http.StatusExpectationFailed, apitypes.Error("invalid file", valErr)) + c.JSON(http.StatusExpectationFailed, valErr) return } c.JSON(http.StatusOK, apitypes.Success("file validated"))