Skip to content

Commit 21ca054

Browse files
committed
fix session apis
1 parent 2a951cc commit 21ca054

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

openapi.yaml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ externalDocs:
2525
url: https://openparkproject.github.io/OPP-wiki/
2626

2727
tags:
28-
- name: user
29-
description: user management
3028
- name: session
3129
description: session management
30+
- name: user
31+
description: user management
3232
- name: car
3333
description: car management
3434
- name: ticket
@@ -43,7 +43,7 @@ security:
4343

4444
paths:
4545

46-
/sessions:
46+
/login:
4747

4848
post:
4949
tags:
@@ -81,21 +81,19 @@ paths:
8181
$ref: '#/components/responses/NotFoundError'
8282
security: []
8383

84-
/sessions/current:
85-
8684
get:
8785
tags:
8886
- session
89-
summary: Get current logged user
90-
description: Get current logged user
91-
operationId: getCurrentSession
87+
summary: Get current session (get new token)
88+
description: Get current session (get new token)
89+
operationId: getSession
9290
responses:
9391
'200':
9492
description: Successful operation
9593
content:
9694
application/json:
9795
schema:
98-
$ref: '#/components/schemas/UserResponse'
96+
$ref: '#/components/schemas/SessionResponse'
9997
'400':
10098
$ref: '#/components/responses/InvalidInputError'
10199
'422':
@@ -110,8 +108,49 @@ paths:
110108
$ref: '#/components/responses/ForbiddenError'
111109
'404':
112110
$ref: '#/components/responses/NotFoundError'
111+
security: []
113112

114-
delete:
113+
/register:
114+
115+
post:
116+
tags:
117+
- session
118+
summary: Register
119+
description: Register
120+
operationId: register
121+
requestBody:
122+
description: Register
123+
content:
124+
application/json:
125+
schema:
126+
$ref: '#/components/schemas/UserRequest'
127+
required: true
128+
responses:
129+
'201':
130+
description: Registration successful
131+
content:
132+
application/json:
133+
schema:
134+
$ref: '#/components/schemas/SessionResponse'
135+
'400':
136+
$ref: '#/components/responses/InvalidInputError'
137+
'422':
138+
$ref: '#/components/responses/ValidationError'
139+
'500':
140+
$ref: '#/components/responses/InternalServerError'
141+
'503':
142+
$ref: '#/components/responses/UnexpectedError'
143+
'401':
144+
$ref: '#/components/responses/UnauthorizedError'
145+
'403':
146+
$ref: '#/components/responses/ForbiddenError'
147+
'404':
148+
$ref: '#/components/responses/NotFoundError'
149+
security: []
150+
151+
/logout:
152+
153+
post:
115154
tags:
116155
- session
117156
summary: Logout
@@ -143,8 +182,6 @@ paths:
143182
summary: Get all users
144183
description: Get all users
145184
operationId: getUsers
146-
x-required-permissions:
147-
- users:read:all
148185
parameters:
149186
- name: limit
150187
in: query
@@ -187,42 +224,6 @@ paths:
187224
'404':
188225
$ref: '#/components/responses/NotFoundError'
189226

190-
post:
191-
tags:
192-
- user
193-
summary: Create a new user (Registration)
194-
description: Create a new user (Registration)
195-
operationId: addUser
196-
requestBody:
197-
description: Create a new user (Registration)
198-
content:
199-
application/json:
200-
schema:
201-
$ref: '#/components/schemas/UserRequest'
202-
required: true
203-
responses:
204-
'201':
205-
description: User created successfully
206-
content:
207-
application/json:
208-
schema:
209-
$ref: '#/components/schemas/UserResponse'
210-
'400':
211-
$ref: '#/components/responses/InvalidInputError'
212-
'422':
213-
$ref: '#/components/responses/ValidationError'
214-
'500':
215-
$ref: '#/components/responses/InternalServerError'
216-
'503':
217-
$ref: '#/components/responses/UnexpectedError'
218-
'401':
219-
$ref: '#/components/responses/UnauthorizedError'
220-
'403':
221-
$ref: '#/components/responses/ForbiddenError'
222-
'404':
223-
$ref: '#/components/responses/NotFoundError'
224-
security: []
225-
226227
delete:
227228
tags:
228229
- user

0 commit comments

Comments
 (0)