forked from zircote/swagger-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsersController.php
More file actions
36 lines (33 loc) · 956 Bytes
/
UsersController.php
File metadata and controls
36 lines (33 loc) · 956 Bytes
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
<?php
namespace OpenApi\Examples\UsingLinksPhp81;
use OpenApi\Attributes as OAT;
/**
* MVC controller that handles "users/*" urls.
*/
class UsersController
{
#[OAT\Get(
path: '/2.0/users/{username}',
operationId: 'getUserByName',
summary: 'Get user details by username',
tags: ['Users'],
parameters: [
new OAT\Parameter(
name: 'username',
in: 'path',
required: true,
schema: new OAT\Schema(type: 'string')
)],
responses: [
new OAT\Response(
response: 200,
description: 'The User',
content: new OAT\JsonContent(ref: '#/components/schemas/user'),
links: [new OAT\Link(link: 'userRepositories', ref: '#/components/links/UserRepositories')]
),
]
)]
public function getUserByName(string $username)
{
}
}