Skip to content

Commit f445be5

Browse files
committed
fix(swagger): endpoint doc
Signed-off-by: smarcet <smarcet@gmail.com>
1 parent 777f6bd commit f445be5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/Http/Controllers/Api/OAuth2/OAuth2UserApiController.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,17 @@ public function get($id)
342342
#[OA\Get(
343343
path: '/api/v2/users/{id}',
344344
summary: 'Get a user by ID',
345-
description: 'Get a user by ID (only for accounts of type "SERVICE")',
345+
description: 'Retrieves user details by their numeric ID.',
346346
operationId: 'getUserByIdV2',
347-
tags: ['Users'],
347+
tags: ['Users', 'V2'],
348348
security: [
349349
['OAuth2UserSecurity' => [
350350
IUserScopes::ReadAll,
351351
]],
352352
],
353+
x: [
354+
'x-required-client-type' => 'SERVICE',
355+
],
353356
parameters: [
354357
new OA\Parameter(
355358
name: 'id',
@@ -380,6 +383,10 @@ public function get($id)
380383
response: HttpResponse::HTTP_INTERNAL_SERVER_ERROR,
381384
description: 'Server Error'
382385
),
386+
new OA\Response(
387+
response: HttpResponse::HTTP_FORBIDDEN,
388+
description: 'Forbidden - Only service accounts are allowed'
389+
),
383390
]
384391
)]
385392
public function getV2($id)

0 commit comments

Comments
 (0)