-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
233 lines (222 loc) · 4.9 KB
/
swagger.yaml
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
swagger: "2.0"
info:
title: "Member-Crud"
version: "1.0"
contact: {}
definitions:
models.Member:
properties:
contractDuration:
type: integer
createdAt:
type: string
deletedAt:
type: string
id:
type: integer
name:
type: string
role:
type: string
tags:
items:
$ref: '#/definitions/models.Tag'
type: array
type:
enum:
- EMPLOYEE
- CONTRACTOR
type: string
updatedAt:
type: string
required:
- name
- type
type: object
models.Tag:
properties:
createdAt:
type: string
deletedAt:
type: string
id:
type: integer
members:
items:
$ref: '#/definitions/models.Member'
type: array
name:
type: string
updatedAt:
type: string
type: object
paths:
/api/health:
get:
description: Checks the health status of the server and database connection
produces:
- text/plain
responses:
"200":
description: Ok
schema:
type: string
"500":
description: Could not establish a connection to the database
schema:
type: string
summary: Health endpoint
tags:
- health
/api/v1/members:
get:
description: Get all members with tags
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/models.Member'
type: array
summary: Get all members with tags
tags:
- members
post:
consumes:
- application/json
description: Add a new member
parameters:
- description: Member object that needs to be added
in: body
name: member
required: true
schema:
$ref: '#/definitions/models.Member'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Member'
summary: Add a new member
tags:
- members
/api/v1/members/{id}:
get:
description: Get a member by ID with tags
parameters:
- description: Member ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Member'
summary: Get a member by ID with tags
tags:
- members
delete:
description: Delete a member by ID
parameters:
- description: Member ID
in: path
name: id
required: true
type: string
responses:
"200":
description: Member deleted successfully
schema:
type: string
summary: Delete a member
tags:
- members
put:
description: Update a member by ID
parameters:
- description: Member ID
in: path
name: id
required: true
type: string
- description: Member object that needs to be added
in: body
name: member
required: true
schema:
$ref: '#/definitions/models.Member'
produces:
- application/json
responses:
"200":
description: Member updated successfully
schema:
type: string
summary: Update a member
tags:
- members
/api/v1/members/search:
get:
description: Search members
produces:
- application/json
tags:
- members
summary: Search members
parameters:
- type: array
items:
type: string
collectionFormat: multi
description: Tags to search for
name: tags
in: query
required: false
- type: string
description: Member type to search for
name: type
in: query
required: false
responses:
"200":
description: OK
schema:
type: array
items:
$ref: '#/definitions/models.Member'
/api/ping:
get:
description: Checks the availability of the server
produces:
- text/plain
responses:
"200":
description: Ok
schema:
type: string
summary: Ping endpoint
tags:
- ping
/api/v1/tags:
get:
description: Gets all tags
produces:
- application/json
responses:
"200":
description: OK
schema:
type: array
items:
$ref: '#/definitions/models.Tag'
summary: Get all tags
tags:
- tags