gofiber-study/docs/swagger.json

263 lines
8.3 KiB
JSON
Raw Normal View History

2022-10-03 15:10:03 +08:00
{
"swagger": "2.0",
"info": {
"description": "基于 Fiber 框架的 swagger",
"title": "GoFiber Study API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Shikong",
"email": "919411476@qq.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"basePath": "/",
"paths": {
"/": {
"get": {
"description": "简单的 HelloWorld 示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"HelloWorld"
],
"summary": "HelloWorld",
"responses": {
"200": {
"description": "OK",
"schema": {
2022-10-03 15:37:55 +08:00
"allOf": [
{
"$ref": "#/definitions/response.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
2022-10-03 15:10:03 +08:00
}
},
2022-10-03 15:37:55 +08:00
"default": {
"description": "",
2022-10-03 15:10:03 +08:00
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
2022-10-03 15:37:55 +08:00
}
}
}
},
"/error": {
"get": {
"description": "错误信息示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Error"
],
"summary": "错误处理",
"responses": {
"default": {
"description": "",
2022-10-03 15:10:03 +08:00
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
2022-10-03 15:37:55 +08:00
}
}
},
"put": {
"description": "错误信息示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Error"
],
"summary": "错误处理",
"responses": {
"default": {
"description": "",
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
}
}
},
"post": {
"description": "错误信息示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Error"
],
"summary": "错误处理",
"responses": {
"default": {
"description": "",
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
}
}
},
"delete": {
"description": "错误信息示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Error"
],
"summary": "错误处理",
"responses": {
"default": {
"description": "",
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
}
}
},
"patch": {
2022-10-03 15:37:55 +08:00
"description": "错误信息示例",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Error"
],
"summary": "错误处理",
"responses": {
"default": {
"description": "",
"schema": {
"$ref": "#/definitions/errorx.CodeErrorResponse"
}
}
}
}
},
"/routes": {
"get": {
"description": "获取所有路由信息",
2022-10-03 15:37:55 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Routes"
2022-10-03 15:37:55 +08:00
],
"summary": "获取所有路由",
2022-10-03 15:37:55 +08:00
"responses": {
"200": {
"description": "OK",
2022-10-03 15:10:03 +08:00
"schema": {
2022-10-04 13:06:13 +08:00
"allOf": [
{
"$ref": "#/definitions/response.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/fiber.Route"
}
}
}
}
}
]
2022-10-03 15:10:03 +08:00
}
}
}
}
}
},
"definitions": {
"errorx.CodeErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 200
},
"data": {},
"msg": {
"type": "string",
"example": "OK"
}
}
2022-10-03 15:37:55 +08:00
},
2022-10-04 13:06:13 +08:00
"fiber.Route": {
"type": "object",
"properties": {
"method": {
"description": "Public fields",
"type": "string"
},
"name": {
"description": "Route's name",
"type": "string"
},
"params": {
"description": "Case sensitive param keys",
"type": "array",
"items": {
"type": "string"
}
},
"path": {
"description": "Original registered route path",
"type": "string"
}
}
},
2022-10-03 15:37:55 +08:00
"response.Response": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 200
},
"data": {},
"msg": {
"type": "string",
"example": "OK"
}
}
2022-10-03 15:10:03 +08:00
}
}
}