Define servers
#[
Server('same server1', 'https//example.com'),
Server('same server2', 'https//example.org'),
]
class BaseController
{
//
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Define info
Only title is required. Others props are optional.
#[
Info(
'title',
'1.0.0',
'description',
'https://example.com/termsOfService',
[
'name' => 'API Support',
'url' => 'https://example.com/support',
'email' => 'support@output.json.com'
],
[
'name' => 'Apache 2.0',
'url' => 'https://www.apache.org/licenses/LICENSE-2.0.html'
],
),
]
class BaseController
{
//
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Define security schema
#[
SecurityScheme(
'bearerAuth',
'http',
'bearerAuth',
'header',
'bearer',
'JWT',
),
]
class BaseController
{
//
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14