Skip to content

Commit a8f881d

Browse files
committed
Revert "Swagger fix (add prefix, fix auth header name)"
This reverts commit 546b416.
1 parent 546b416 commit a8f881d

15 files changed

+212
-217
lines changed

src/Identity/Controller/AdminAttributeDefinitionController.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242

4343
#[Route('', name: 'create', methods: ['POST'])]
4444
#[OA\Post(
45-
path: '/api/v2/administrators/attributes',
45+
path: '/administrators/attributes',
4646
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
4747
'Returns created admin attribute definition.',
4848
summary: 'Create an admin attribute definition.',
@@ -54,8 +54,8 @@ public function __construct(
5454
tags: ['admin-attributes'],
5555
parameters: [
5656
new OA\Parameter(
57-
name: 'php-auth-pw',
58-
description: 'Session key obtained from login',
57+
name: 'session',
58+
description: 'Session ID obtained from authentication',
5959
in: 'header',
6060
required: true,
6161
schema: new OA\Schema(
@@ -96,7 +96,7 @@ public function create(Request $request): JsonResponse
9696

9797
#[Route('/{definitionId}', name: 'update', requirements: ['definitionId' => '\d+'], methods: ['PUT'])]
9898
#[OA\Put(
99-
path: '/api/v2/administrators/attributes/{definitionId}',
99+
path: '/administrators/attributes/{definitionId}',
100100
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
101101
'Returns updated admin attribute definition.',
102102
summary: 'Update an admin attribute definition.',
@@ -115,8 +115,8 @@ public function create(Request $request): JsonResponse
115115
schema: new OA\Schema(type: 'string')
116116
),
117117
new OA\Parameter(
118-
name: 'php-auth-pw',
119-
description: 'Session key obtained from login',
118+
name: 'session',
119+
description: 'Session ID obtained from authentication',
120120
in: 'header',
121121
required: true,
122122
schema: new OA\Schema(type: 'string')
@@ -163,15 +163,15 @@ public function update(
163163

164164
#[Route('/{definitionId}', name: 'delete', requirements: ['definitionId' => '\d+'], methods: ['DELETE'])]
165165
#[OA\Delete(
166-
path: '/api/v2/administrators/attributes/{definitionId}',
166+
path: '/administrators/attributes/{definitionId}',
167167
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
168168
'Deletes a single admin attribute definition.',
169169
summary: 'Deletes an attribute definition.',
170170
tags: ['admin-attributes'],
171171
parameters: [
172172
new OA\Parameter(
173-
name: 'php-auth-pw',
174-
description: 'Session key obtained from login',
173+
name: 'session',
174+
description: 'Session ID',
175175
in: 'header',
176176
required: true,
177177
schema: new OA\Schema(type: 'string')
@@ -217,18 +217,20 @@ public function delete(
217217

218218
#[Route('', name: 'get_lists', methods: ['GET'])]
219219
#[OA\Get(
220-
path: '/api/v2/administrators/attributes',
220+
path: '/administrators/attributes',
221221
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
222222
'Returns a JSON list of all admin attribute definitions.',
223223
summary: 'Gets a list of all admin attribute definitions.',
224224
tags: ['admin-attributes'],
225225
parameters: [
226226
new OA\Parameter(
227-
name: 'php-auth-pw',
228-
description: 'Session key obtained from login',
227+
name: 'session',
228+
description: 'Session ID obtained from authentication',
229229
in: 'header',
230230
required: true,
231-
schema: new OA\Schema(type: 'string')
231+
schema: new OA\Schema(
232+
type: 'string'
233+
)
232234
),
233235
new OA\Parameter(
234236
name: 'after_id',
@@ -284,7 +286,7 @@ public function getPaginated(Request $request): JsonResponse
284286

285287
#[Route('/{definitionId}', name: 'get_one', requirements: ['definitionId' => '\d+'], methods: ['GET'])]
286288
#[OA\Get(
287-
path: '/api/v2/administrators/attributes/{definitionId}',
289+
path: '/administrators/attributes/{definitionId}',
288290
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
289291
'Returns a single attribute with specified ID.',
290292
summary: 'Gets attribute with specified ID.',
@@ -298,8 +300,8 @@ public function getPaginated(Request $request): JsonResponse
298300
schema: new OA\Schema(type: 'string')
299301
),
300302
new OA\Parameter(
301-
name: 'php-auth-pw',
302-
description: 'Session key obtained from login',
303+
name: 'session',
304+
description: 'Session ID obtained from authentication',
303305
in: 'header',
304306
required: true,
305307
schema: new OA\Schema(type: 'string')

src/Identity/Controller/AdminAttributeValueController.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ public function __construct(
4242
}
4343

4444
#[Route(
45-
path: '/api/v2/{adminId}/{definitionId}',
45+
path: '/{adminId}/{definitionId}',
4646
name: 'create',
4747
requirements: ['adminId' => '\d+', 'definitionId' => '\d+'],
4848
methods: ['POST', 'PUT'],
4949
)]
5050
#[OA\Post(
51-
path: '/api/v2/administrators/attribute-values/{adminId}/{definitionId}',
51+
path: '/administrators/attribute-values/{adminId}/{definitionId}',
5252
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
5353
'Returns created/updated admin attribute.',
5454
summary: 'Create/update an admin attribute.',
@@ -64,8 +64,8 @@ public function __construct(
6464
tags: ['admin-attributes'],
6565
parameters: [
6666
new OA\Parameter(
67-
name: 'php-auth-pw',
68-
description: 'Session key obtained from login',
67+
name: 'session',
68+
description: 'Session ID obtained from authentication',
6969
in: 'header',
7070
required: true,
7171
schema: new OA\Schema(type: 'string')
@@ -128,21 +128,21 @@ public function createOrUpdate(
128128
}
129129

130130
#[Route(
131-
path: '/api/v2/{adminId}/{definitionId}',
131+
path: '/{adminId}/{definitionId}',
132132
name: 'delete',
133133
requirements: ['adminId' => '\d+', 'definitionId' => '\d+'],
134134
methods: ['DELETE'],
135135
)]
136136
#[OA\Delete(
137-
path: '/api/v2/administrators/attribute-values/{adminId}/{definitionId}',
137+
path: '/administrators/attribute-values/{adminId}/{definitionId}',
138138
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
139139
'Deletes a single admin attribute.',
140140
summary: 'Deletes an attribute.',
141141
tags: ['admin-attributes'],
142142
parameters: [
143143
new OA\Parameter(
144-
name: 'php-auth-pw',
145-
description: 'Session key obtained from login',
144+
name: 'session',
145+
description: 'Session ID',
146146
in: 'header',
147147
required: true,
148148
schema: new OA\Schema(type: 'string')
@@ -199,15 +199,15 @@ public function delete(
199199

200200
#[Route('/{adminId}', name: 'get__list', requirements: ['adminId' => '\d+'], methods: ['GET'])]
201201
#[OA\Get(
202-
path: '/api/v2/administrators/attribute-values/{adminId}',
202+
path: '/administrators/attribute-values/{adminId}',
203203
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
204204
'Returns a JSON list of all admin attributes.',
205205
summary: 'Gets a list of all admin attributes.',
206206
tags: ['admin-attributes'],
207207
parameters: [
208208
new OA\Parameter(
209-
name: 'php-auth-pw',
210-
description: 'Session key obtained from login',
209+
name: 'session',
210+
description: 'Session ID obtained from authentication',
211211
in: 'header',
212212
required: true,
213213
schema: new OA\Schema(type: 'string')
@@ -281,7 +281,7 @@ public function getPaginated(
281281

282282
#[Route('/{adminId}/{definitionId}', name: 'get_one', methods: ['GET'])]
283283
#[OA\Get(
284-
path: '/api/v2/administrators/attribute-values/{adminId}/{definitionId}',
284+
path: '/administrators/attribute-values/{adminId}/{definitionId}',
285285
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
286286
'Returns a single attribute.',
287287
summary: 'Gets admin attribute.',
@@ -302,8 +302,8 @@ public function getPaginated(
302302
schema: new OA\Schema(type: 'integer')
303303
),
304304
new OA\Parameter(
305-
name: 'php-auth-pw',
306-
description: 'Session key obtained from login',
305+
name: 'session',
306+
description: 'Session ID obtained from authentication',
307307
in: 'header',
308308
required: true,
309309
schema: new OA\Schema(type: 'string')

src/Identity/Controller/AdministratorController.php

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ public function __construct(
4545

4646
#[Route('', name: 'get_list', methods: ['GET'])]
4747
#[OA\Get(
48-
path: '/api/v2/administrators',
48+
path: '/administrators',
4949
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
5050
'Get list of administrators.',
5151
summary: 'Get Administrators',
5252
tags: ['administrators'],
5353
parameters: [
5454
new OA\Parameter(
55-
name: 'php-auth-pw',
56-
description: 'Session key obtained from login',
55+
name: 'session',
56+
description: 'Session ID obtained from authentication',
5757
in: 'header',
5858
required: true,
59-
schema: new OA\Schema(type: 'string')
59+
schema: new OA\Schema(
60+
type: 'string'
61+
)
6062
),
6163
new OA\Parameter(
6264
name: 'after_id',
@@ -107,7 +109,7 @@ public function getAdministrators(Request $request): JsonResponse
107109

108110
#[Route('', name: 'create', methods: ['POST'])]
109111
#[OA\Post(
110-
path: '/api/v2/administrators',
112+
path: '/administrators',
111113
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
112114
'Create a new administrator.',
113115
summary: 'Create Administrator',
@@ -117,15 +119,6 @@ public function getAdministrators(Request $request): JsonResponse
117119
content: new OA\JsonContent(ref: '#/components/schemas/CreateAdministratorRequest')
118120
),
119121
tags: ['administrators'],
120-
parameters: [
121-
new OA\Parameter(
122-
name: 'php-auth-pw',
123-
description: 'Session key obtained from login',
124-
in: 'header',
125-
required: true,
126-
schema: new OA\Schema(type: 'string')
127-
),
128-
],
129122
responses: [
130123
new OA\Response(
131124
response: 201,
@@ -156,7 +149,7 @@ public function createAdministrator(
156149

157150
#[Route('/{administratorId}', name: 'get_one', requirements: ['administratorId' => '\d+'], methods: ['GET'])]
158151
#[OA\Get(
159-
path: '/api/v2/administrators/{administratorId}',
152+
path: '/administrators/{administratorId}',
160153
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
161154
'Get administrator by ID.',
162155
summary: 'Get Administrator',
@@ -168,14 +161,7 @@ public function createAdministrator(
168161
in: 'path',
169162
required: true,
170163
schema: new OA\Schema(type: 'integer')
171-
),
172-
new OA\Parameter(
173-
name: 'php-auth-pw',
174-
description: 'Session key obtained from login',
175-
in: 'header',
176-
required: true,
177-
schema: new OA\Schema(type: 'string')
178-
),
164+
)
179165
],
180166
responses: [
181167
new OA\Response(
@@ -205,7 +191,7 @@ public function getAdministrator(
205191

206192
#[Route('/{administratorId}', name: 'update', requirements: ['administratorId' => '\d+'], methods: ['PUT'])]
207193
#[OA\Put(
208-
path: '/api/v2/administrators/{administratorId}',
194+
path: '/administrators/{administratorId}',
209195
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
210196
'Update an administrator.',
211197
summary: 'Update Administrator',
@@ -222,14 +208,7 @@ public function getAdministrator(
222208
in: 'path',
223209
required: true,
224210
schema: new OA\Schema(type: 'integer')
225-
),
226-
new OA\Parameter(
227-
name: 'php-auth-pw',
228-
description: 'Session key obtained from login',
229-
in: 'header',
230-
required: true,
231-
schema: new OA\Schema(type: 'string')
232-
),
211+
)
233212
],
234213
responses: [
235214
new OA\Response(
@@ -260,7 +239,7 @@ public function updateAdministrator(
260239

261240
#[Route('/{administratorId}', name: 'delete', requirements: ['administratorId' => '\d+'], methods: ['DELETE'])]
262241
#[OA\Delete(
263-
path: '/api/v2/administrators/{administratorId}',
242+
path: '/administrators/{administratorId}',
264243
description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
265244
'Delete an administrator.',
266245
summary: 'Delete Administrator',
@@ -272,14 +251,7 @@ public function updateAdministrator(
272251
in: 'path',
273252
required: true,
274253
schema: new OA\Schema(type: 'integer')
275-
),
276-
new OA\Parameter(
277-
name: 'php-auth-pw',
278-
description: 'Session key obtained from login',
279-
in: 'header',
280-
required: true,
281-
schema: new OA\Schema(type: 'string')
282-
),
254+
)
283255
],
284256
responses: [
285257
new OA\Response(

src/Identity/Controller/SessionController.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242

4343
#[Route('', name: 'create', methods: ['POST'])]
4444
#[OA\Post(
45-
path: '/api/v2/sessions',
45+
path: '/sessions',
4646
description: '✅ **Status: Stable** – This method is stable and safe for production use. ' .
4747
'Given valid login data, this will generate a login token that will be valid for 1 hour.',
4848
summary: 'Log in or create new session.',
@@ -111,26 +111,19 @@ public function createSession(
111111
*/
112112
#[Route('/{sessionId}', name: 'delete', requirements: ['sessionId' => '\d+'], methods: ['DELETE'])]
113113
#[OA\Delete(
114-
path: '/api/v2/sessions/{sessionId}',
114+
path: '/sessions/{sessionId}',
115115
description: '✅ **Status: Stable** – This method is stable and safe for production use. ' .
116116
'Delete the session passed as a parameter.',
117117
summary: 'Delete a session.',
118118
tags: ['sessions'],
119119
parameters: [
120-
new OA\Parameter(
121-
name: 'php-auth-pw',
122-
description: 'Session key obtained from login',
123-
in: 'header',
124-
required: true,
125-
schema: new OA\Schema(type: 'string')
126-
),
127120
new OA\Parameter(
128121
name: 'sessionId',
129-
description: 'Session id (not key as for authentication) obtained from login',
122+
description: 'Session ID',
130123
in: 'path',
131124
required: true,
132125
schema: new OA\Schema(type: 'string')
133-
),
126+
)
134127
],
135128
responses: [
136129
new OA\Response(

0 commit comments

Comments
 (0)