mirror of
https://github.com/TheWhiteDog9487/WebAPI.git
synced 2026-08-11 23:01:30 +08:00
修正错误的Swagger文档
This commit is contained in:
@@ -55,38 +55,39 @@ class Message {
|
|||||||
" \"内容\": \"写点什么好呢\",\n" +
|
" \"内容\": \"写点什么好呢\",\n" +
|
||||||
" \"频道ID\": \"1398192763845214239\"\n" +
|
" \"频道ID\": \"1398192763845214239\"\n" +
|
||||||
" }\n" +
|
" }\n" +
|
||||||
"}") ),
|
"}", name = "成功") ),
|
||||||
description = "消息发送成功,响应体中包含新消息的ID、频道ID和内容"),
|
description = "消息发送成功,响应体中包含新消息的ID、频道ID和内容"),
|
||||||
@ApiResponse(responseCode = "400",
|
@ApiResponse(responseCode = "400",
|
||||||
content = @Content(
|
content = @Content(
|
||||||
mediaType = MediaType.APPLICATION_JSON_VALUE,
|
mediaType = MediaType.APPLICATION_JSON_VALUE,
|
||||||
schema = @Schema(implementation = ResponseData.class),
|
schema = @Schema(implementation = ResponseData.class),
|
||||||
examples = { @ExampleObject(value = "{\n" +
|
examples = @ExampleObject(value = "{\n" +
|
||||||
" \"code\": 400,\n" +
|
|
||||||
" \"message\": \"请求缺少必要的头部信息\",\n" +
|
|
||||||
" \"data\": {\n" +
|
|
||||||
" \"缺失的头部\": \"X-API-Key\"\n" +
|
|
||||||
" }\n" +
|
|
||||||
"}", name = "缺少头部信息") ,
|
|
||||||
@ExampleObject(value = "{\n" +
|
|
||||||
" \"code\": 400,\n" +
|
" \"code\": 400,\n" +
|
||||||
" \"message\": \"请求体无法解析\",\n" +
|
" \"message\": \"请求体无法解析\",\n" +
|
||||||
" \"data\": {\n" +
|
" \"data\": {\n" +
|
||||||
" \"错误信息\": \"JSON parse error: Unexpected character ('}' (code 125)): was expecting double-quote to start field name\"\n" +
|
" \"错误信息\": \"JSON parse error: Unexpected character ('}' (code 125)): was expecting double-quote to start field name\"\n" +
|
||||||
" }\n" +
|
" }\n" +
|
||||||
"}", name = "请求体无法解析") } ),
|
"}", name = "请求体无法解析") ),
|
||||||
description = "客户端发送的请求存在问题,请检查响应的data字段以获取更多信息"),
|
description = "客户端发送的请求存在问题,请检查响应的data字段以获取更多信息"),
|
||||||
@ApiResponse(responseCode = "401",
|
@ApiResponse(responseCode = "401",
|
||||||
content = @Content(
|
content = @Content(
|
||||||
mediaType = MediaType.APPLICATION_JSON_VALUE,
|
mediaType = MediaType.APPLICATION_JSON_VALUE,
|
||||||
schema = @Schema(implementation = ResponseData.class),
|
schema = @Schema(implementation = ResponseData.class),
|
||||||
examples = @ExampleObject(value = "{\n" +
|
examples = {
|
||||||
|
@ExampleObject(value = "{\n" +
|
||||||
|
" \"code\": 401,\n" +
|
||||||
|
" \"message\": \"请求缺少必要的头部信息\",\n" +
|
||||||
|
" \"data\": {\n" +
|
||||||
|
" \"缺失的头部\": \"X-API-Key\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
"}", name = "缺少头部信息"),
|
||||||
|
@ExampleObject(value = "{\n" +
|
||||||
" \"code\": 401,\n" +
|
" \"code\": 401,\n" +
|
||||||
" \"message\": \"API密钥验证失败\",\n" +
|
" \"message\": \"API密钥验证失败\",\n" +
|
||||||
" \"data\": {\n" +
|
" \"data\": {\n" +
|
||||||
" \"提供的密钥\": \"123456\"\n" +
|
" \"提供的密钥\": \"123456\"\n" +
|
||||||
" }\n" +
|
" }\n" +
|
||||||
"}") ),
|
"}", name = "密钥不正确") } ),
|
||||||
description = "API密钥验证失败"),
|
description = "API密钥验证失败"),
|
||||||
@ApiResponse(responseCode = "500",
|
@ApiResponse(responseCode = "500",
|
||||||
content = @Content(
|
content = @Content(
|
||||||
|
|||||||
Reference in New Issue
Block a user