forked from ElvisYong/rust-axum-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.json
117 lines (117 loc) · 2.73 KB
/
openapi.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"openapi": "3.0.3",
"info": {
"title": "rust-axum-scaffold",
"description": "This is a sample generated openapi documentation for reference",
"contact": {
"name": "Yong Yu En, Elvis"
},
"license": {
"name": ""
},
"version": "0.1.0"
},
"servers": [
{
"url": "0.0.0.0"
}
],
"paths": {
"/health": {
"get": {
"tags": [
"health"
],
"operationId": "get_health_check",
"responses": {
"200": {
"description": "Health check passed"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/user/:id": {
"get": {
"tags": [
"user"
],
"summary": "Get current user",
"description": "Get current user\nThis endpoint will return the current user",
"operationId": "get_current_user",
"responses": {
"200": {
"description": "Successfully retrieved user",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserViewModel"
}
}
}
}
},
"500": {
"description": "Internal Server Error"
}
}
}
}
},
"components": {
"schemas": {
"UserViewModel": {
"type": "object",
"description": "User response view model",
"required": [
"id",
"email",
"username",
"bio"
],
"properties": {
"bio": {
"type": "string",
"description": "Bio of the user",
"example": "I love to eat"
},
"email": {
"type": "string",
"description": "Email of the user",
"example": "[email protected]"
},
"id": {
"type": "string",
"description": "The unique identifier of the user",
"example": "ppId123"
},
"image": {
"type": "string",
"description": "Image of the user",
"example": "https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986",
"nullable": true
},
"username": {
"type": "string",
"description": "Username of the user",
"example": "pplogin"
}
}
}
}
},
"tags": [
{
"name": "health",
"description": "Basic health check to see if the server is up"
},
{
"name": "user",
"description": "Operations about use"
}
]
}