From 32971b45c3f35701622df3af92497e33b9905db1 Mon Sep 17 00:00:00 2001 From: yusing Date: Thu, 29 Jan 2026 10:49:41 +0800 Subject: [PATCH] chore(swagger): update API documentation annotations - Change ValidateFile endpoint Accept type from text/plain to json - Add Route struct name annotation for Swagger documentation --- internal/api/v1/file/validate.go | 4 ++-- internal/route/route.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/v1/file/validate.go b/internal/api/v1/file/validate.go index 4b0e7d28..dab99324 100644 --- a/internal/api/v1/file/validate.go +++ b/internal/api/v1/file/validate.go @@ -20,7 +20,7 @@ type ValidateFileRequest struct { // @Summary Validate file // @Description Validate file // @Tags file -// @Accept text/plain +// @Accept json // @Produce json // @Param type query FileType true "Type" // @Param file body string true "File content" @@ -29,7 +29,7 @@ type ValidateFileRequest struct { // @Failure 403 {object} apitypes.ErrorResponse "Forbidden" // @Failure 417 {object} any "Validation failed" // @Failure 500 {object} apitypes.ErrorResponse "Internal server error" -// @Router /file/validate [post] +// @Router /file/validate [post] func Validate(c *gin.Context) { var request ValidateFileRequest if err := c.ShouldBindQuery(&request); err != nil { diff --git a/internal/route/route.go b/internal/route/route.go index 6152ef5c..4891950c 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -69,7 +69,7 @@ type ( Idlewatcher *types.IdlewatcherConfig `json:"idlewatcher,omitempty" extensions:"x-nullable"` Metadata `deserialize:"-"` - } + } // @name Route Metadata struct { /* Docker only */