forked from zircote/swagger-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PathItem.php
158 lines (138 loc) · 3.71 KB
/
PathItem.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php declare(strict_types=1);
/**
* @license Apache 2.0
*/
namespace OpenApi\Annotations;
use OpenApi\Generator;
/**
* Describes the operations available on a single path.
*
* A Path Item may be empty, due to ACL constraints.
* The path itself is still exposed to the documentation viewer, but they will not know which operations and parameters are available.
*
* @see [OAI Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object)
*
* @Annotation
*/
class PathItem extends AbstractAnnotation
{
/**
* @see [Using refs](https://swagger.io/docs/specification/using-ref/)
*
* @var string|class-string|object
*/
public $ref = Generator::UNDEFINED;
/**
* An optional, string summary, intended to apply to all operations in this path.
*
* @var string
*/
public $summary = Generator::UNDEFINED;
/**
* An optional, string description, intended to apply to all operations in this path.
*
* @var string
*/
public $description = Generator::UNDEFINED;
/**
* Key for the Path Object (OpenApi->paths array).
*
* @var string
*/
public $path = Generator::UNDEFINED;
/**
* A definition of a GET operation on this path.
*
* @var Get
*/
public $get = Generator::UNDEFINED;
/**
* A definition of a PUT operation on this path.
*
* @var Put
*/
public $put = Generator::UNDEFINED;
/**
* A definition of a POST operation on this path.
*
* @var Post
*/
public $post = Generator::UNDEFINED;
/**
* A definition of a DELETE operation on this path.
*
* @var Delete
*/
public $delete = Generator::UNDEFINED;
/**
* A definition of a OPTIONS operation on this path.
*
* @var Options
*/
public $options = Generator::UNDEFINED;
/**
* A definition of a HEAD operation on this path.
*
* @var Head
*/
public $head = Generator::UNDEFINED;
/**
* A definition of a PATCH operation on this path.
*
* @var Patch
*/
public $patch = Generator::UNDEFINED;
/**
* A definition of a TRACE operation on this path.
*
* @var Trace
*/
public $trace = Generator::UNDEFINED;
/**
* An alternative server array to service all operations in this path.
*
* @var Server[]
*/
public $servers = Generator::UNDEFINED;
/**
* A list of parameters that are applicable for all the operations described under this path.
*
* These parameters can be overridden at the operation level, but cannot be removed there.
* The list must not include duplicated parameters.
* A unique parameter is defined by a combination of a name and location.
* The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
*
* @var Parameter[]
*/
public $parameters = Generator::UNDEFINED;
/**
* @inheritdoc
*/
public static $_types = [
'path' => 'string',
'summary' => 'string',
];
/**
* @inheritdoc
*/
public static $_nested = [
Get::class => 'get',
Post::class => 'post',
Put::class => 'put',
Delete::class => 'delete',
Patch::class => 'patch',
Trace::class => 'trace',
Head::class => 'head',
Options::class => 'options',
Parameter::class => ['parameters'],
PathParameter::class => ['parameters'],
Server::class => ['servers'],
Attachable::class => ['attachables'],
];
/**
* @inheritdoc
*/
public static $_parents = [
OpenApi::class,
];
}