-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.json
194 lines (194 loc) · 4.3 KB
/
swagger.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
"swagger": "2.0",
"host": "happy-ask-me.bentosa.it",
"basePath": "/api/v1",
"info": {
"version": "1.0.0",
"title": "BENTOSA Q&A API",
"description": "Simple express-based webapp for Q&A during events and seminars",
"contact": {
"name": "BENTOSA",
"email": "[email protected]",
"url": "http://www.bentosa.it"
},
"license": {
"name": "MIT License",
"url": "https://opensource.org/licenses/MIT"
}
},
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/questions": {
"get": {
"summary": "Retrieve a list of Questions",
"operationId": "list",
"responses": {
"200": {
"description": "List of matching questions",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/question"
}
}
},
"default": {
"$ref": "#/responses/defaultError"
}
},
"tags": [
"Question"
]
},
"post": {
"summary": "Create a new Question",
"operationId": "create",
"parameters": [
{
"description": "The Question to be created",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/question"
}
}
],
"responses": {
"201": {
"description": "Question successfully created",
"schema": {
"$ref": "#/definitions/question"
},
"headers": {
"Location": {
"description": "URI of the newly created resource",
"type": "string",
"format": "uri"
}
}
},
"default": {
"$ref": "#/responses/defaultError"
}
},
"tags": [
"Question"
]
}
},
"/questions/{id}": {
"get": {
"summary": "Retrieve a Question by id",
"operationId": "get",
"parameters": [
{
"$ref": "#/parameters/id"
}
],
"responses": {
"200": {
"description": "The requested Question",
"schema": {
"$ref": "#/definitions/question"
}
},
"404": {
"$ref": "#/responses/notFound"
},
"default": {
"$ref": "#/responses/defaultError"
}
},
"tags": [
"Question"
]
}
}
},
"definitions": {
"errorResponse": {
"type": "object",
"properties": {
"error": {
"type": "integer",
"minimum": 100
},
"message": {
"type": "string"
},
"info": {
"type": "string"
}
},
"required": [
"error",
"message"
]
},
"question": {
"type": "object",
"description": "This object represents a Question",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the question"
},
"name": {
"type": "string",
"description": "Name of ther person asking the question"
},
"topic": {
"type": "string",
"description": "Topic of the question"
},
"question": {
"type": "string",
"description": "Actual text of the question"
}
},
"required": [
"name",
"topic",
"question"
]
}
},
"parameters": {
"id": {
"description": "Unique identifier of the resource",
"name": "id",
"in": "path",
"type": "string",
"required": true
}
},
"responses": {
"defaultError": {
"description": "Default/generic error response",
"schema": {
"$ref": "#/definitions/errorResponse"
}
},
"notFound": {
"description": "The requested/specified resource was not found",
"schema": {
"$ref": "#/definitions/errorResponse"
}
}
},
"tags": [
{
"name": "Question",
"description": "A question"
}
]
}