fix(api): wrong "accept" type in file set and validate API

This commit is contained in:
yusing
2025-08-16 17:31:11 +08:00
parent 52324fbef2
commit 1e78a0a0a0
5 changed files with 12 additions and 12 deletions

View File

@@ -684,7 +684,7 @@ const docTemplate = `{
"put": {
"description": "Set file content",
"consumes": [
"application/json"
"text/plain"
],
"produces": [
"application/json"
@@ -792,7 +792,7 @@ const docTemplate = `{
"post": {
"description": "Validate file",
"consumes": [
"application/json"
"text/plain"
],
"produces": [
"application/json"

View File

@@ -682,7 +682,7 @@
"put": {
"description": "Set file content",
"consumes": [
"application/json"
"text/plain"
],
"produces": [
"application/json"
@@ -792,7 +792,7 @@
"post": {
"description": "Validate file",
"consumes": [
"application/json"
"text/plain"
],
"produces": [
"application/json"

View File

@@ -399,11 +399,11 @@ definitions:
- 1mo
type: string
x-enum-comments:
MetricsPeriod1mo: '@name MetricsPeriod1mo'
MetricsPeriod5m: '@name MetricsPeriod5m'
MetricsPeriod15m: '@name MetricsPeriod15m'
MetricsPeriod1d: '@name MetricsPeriod1d'
MetricsPeriod1h: '@name MetricsPeriod1h'
MetricsPeriod1mo: '@name MetricsPeriod1mo'
MetricsPeriod5m: '@name MetricsPeriod5m'
x-enum-varnames:
- MetricsPeriod5m
- MetricsPeriod15m
@@ -1674,7 +1674,7 @@ paths:
x-id: get
put:
consumes:
- application/json
- text/plain
description: Set file content
parameters:
- description: Type
@@ -1747,7 +1747,7 @@ paths:
/file/validate:
post:
consumes:
- application/json
- text/plain
description: Validate file
parameters:
- description: Type
@@ -2031,11 +2031,11 @@ paths:
name: interval
type: string
x-enum-comments:
MetricsPeriod15m: '@name MetricsPeriod15m'
MetricsPeriod1d: '@name MetricsPeriod1d'
MetricsPeriod1h: '@name MetricsPeriod1h'
MetricsPeriod1mo: '@name MetricsPeriod1mo'
MetricsPeriod5m: '@name MetricsPeriod5m'
MetricsPeriod15m: '@name MetricsPeriod15m'
MetricsPeriod1d: '@name MetricsPeriod1d'
x-enum-varnames:
- MetricsPeriod5m
- MetricsPeriod15m

View File

@@ -15,7 +15,7 @@ type SetFileContentRequest GetFileContentRequest
// @Summary Set file content
// @Description Set file content
// @Tags file
// @Accept json
// @Accept text/plain
// @Produce json
// @Param type query FileType true "Type"
// @Param filename query string true "Filename"

View File

@@ -20,7 +20,7 @@ type ValidateFileRequest struct {
// @Summary Validate file
// @Description Validate file
// @Tags file
// @Accept json
// @Accept text/plain
// @Produce json
// @Param type query FileType true "Type"
// @Param file body string true "File content"