mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
chore(swagger): update API documentation annotations
- Change ValidateFile endpoint Accept type from text/plain to json - Add Route struct name annotation for Swagger documentation
This commit is contained in:
@@ -20,7 +20,7 @@ type ValidateFileRequest struct {
|
|||||||
// @Summary Validate file
|
// @Summary Validate file
|
||||||
// @Description Validate file
|
// @Description Validate file
|
||||||
// @Tags file
|
// @Tags file
|
||||||
// @Accept text/plain
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param type query FileType true "Type"
|
// @Param type query FileType true "Type"
|
||||||
// @Param file body string true "File content"
|
// @Param file body string true "File content"
|
||||||
@@ -29,7 +29,7 @@ type ValidateFileRequest struct {
|
|||||||
// @Failure 403 {object} apitypes.ErrorResponse "Forbidden"
|
// @Failure 403 {object} apitypes.ErrorResponse "Forbidden"
|
||||||
// @Failure 417 {object} any "Validation failed"
|
// @Failure 417 {object} any "Validation failed"
|
||||||
// @Failure 500 {object} apitypes.ErrorResponse "Internal server error"
|
// @Failure 500 {object} apitypes.ErrorResponse "Internal server error"
|
||||||
// @Router /file/validate [post]
|
// @Router /file/validate [post]
|
||||||
func Validate(c *gin.Context) {
|
func Validate(c *gin.Context) {
|
||||||
var request ValidateFileRequest
|
var request ValidateFileRequest
|
||||||
if err := c.ShouldBindQuery(&request); err != nil {
|
if err := c.ShouldBindQuery(&request); err != nil {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type (
|
|||||||
Idlewatcher *types.IdlewatcherConfig `json:"idlewatcher,omitempty" extensions:"x-nullable"`
|
Idlewatcher *types.IdlewatcherConfig `json:"idlewatcher,omitempty" extensions:"x-nullable"`
|
||||||
|
|
||||||
Metadata `deserialize:"-"`
|
Metadata `deserialize:"-"`
|
||||||
}
|
} // @name Route
|
||||||
|
|
||||||
Metadata struct {
|
Metadata struct {
|
||||||
/* Docker only */
|
/* Docker only */
|
||||||
|
|||||||
Reference in New Issue
Block a user