1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* It's free open-source software released under the MIT License. |
5
|
|
|
* |
6
|
|
|
* @author Anatoly Fenric <[email protected]> |
7
|
|
|
* @copyright Copyright (c) 2018, Anatoly Fenric |
8
|
|
|
* @license https://github.com/sunrise-php/http-router/blob/master/LICENSE |
9
|
|
|
* @link https://github.com/sunrise-php/http-router |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Sunrise\Http\Router\Annotation\OpenApi; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @Annotation |
16
|
|
|
* |
17
|
|
|
* @Target({"ALL"}) |
18
|
|
|
* |
19
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schema-object |
20
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html |
21
|
|
|
*/ |
22
|
|
|
final class Schema extends AbstractAnnotation implements SchemaInterface |
23
|
|
|
{ |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var \Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface |
27
|
|
|
*/ |
28
|
|
|
public $additionalProperties; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var array<\Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface> |
32
|
|
|
*/ |
33
|
|
|
public $allOf; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var array<\Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface> |
37
|
|
|
*/ |
38
|
|
|
public $anyOf; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var mixed |
42
|
|
|
*/ |
43
|
|
|
public $default; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var bool |
47
|
|
|
* |
48
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-schemadeprecated |
49
|
|
|
*/ |
50
|
|
|
public $deprecated; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var string |
54
|
|
|
*/ |
55
|
|
|
public $description; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var array |
59
|
|
|
* |
60
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.1.2 |
61
|
|
|
*/ |
62
|
|
|
public $enum; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var mixed |
66
|
|
|
* |
67
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-schemaexample |
68
|
|
|
*/ |
69
|
|
|
public $example; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var int |
73
|
|
|
* |
74
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2.3 |
75
|
|
|
*/ |
76
|
|
|
public $exclusiveMaximum; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var int |
80
|
|
|
* |
81
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2.5 |
82
|
|
|
*/ |
83
|
|
|
public $exclusiveMinimum; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string |
87
|
|
|
*/ |
88
|
|
|
public $format; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var \Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface |
92
|
|
|
*/ |
93
|
|
|
public $items; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @var int |
97
|
|
|
* |
98
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2.2 |
99
|
|
|
*/ |
100
|
|
|
public $maximum; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var int |
104
|
|
|
* |
105
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.4.1 |
106
|
|
|
*/ |
107
|
|
|
public $maxItems; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @var int |
111
|
|
|
* |
112
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.3.1 |
113
|
|
|
*/ |
114
|
|
|
public $maxLength; |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @var int |
118
|
|
|
* |
119
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.5.1 |
120
|
|
|
*/ |
121
|
|
|
public $maxProperties; |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @var int |
125
|
|
|
* |
126
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2.4 |
127
|
|
|
*/ |
128
|
|
|
public $minimum; |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @var int |
132
|
|
|
* |
133
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.4.2 |
134
|
|
|
*/ |
135
|
|
|
public $minItems; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @var int |
139
|
|
|
* |
140
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.3.2 |
141
|
|
|
*/ |
142
|
|
|
public $minLength; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @var int |
146
|
|
|
* |
147
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.5.2 |
148
|
|
|
*/ |
149
|
|
|
public $minProperties; |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @var int |
153
|
|
|
* |
154
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2.1 |
155
|
|
|
*/ |
156
|
|
|
public $multipleOf; |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @var \Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface |
160
|
|
|
*/ |
161
|
|
|
public $not; |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @var bool |
165
|
|
|
* |
166
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-schemanullable |
167
|
|
|
*/ |
168
|
|
|
public $nullable; |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* @var array<\Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface> |
172
|
|
|
*/ |
173
|
|
|
public $oneOf; |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @var string |
177
|
|
|
* |
178
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.3.3 |
179
|
|
|
*/ |
180
|
|
|
public $pattern; |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @var array<\Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface> |
184
|
|
|
*/ |
185
|
|
|
public $properties; |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @var bool |
189
|
|
|
* |
190
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-schemareadonly |
191
|
|
|
*/ |
192
|
|
|
public $readOnly; |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @var array<string> |
196
|
|
|
* |
197
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.5.3 |
198
|
|
|
*/ |
199
|
|
|
public $required; |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @var string |
203
|
|
|
* |
204
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.1 |
205
|
|
|
*/ |
206
|
|
|
public $title; |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @var string |
210
|
|
|
*/ |
211
|
|
|
public $type; |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @var bool |
215
|
|
|
* |
216
|
|
|
* @link https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.4.3 |
217
|
|
|
*/ |
218
|
|
|
public $uniqueItems; |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @var bool |
222
|
|
|
* |
223
|
|
|
* @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-schemawriteonly |
224
|
|
|
*/ |
225
|
|
|
public $writeOnly; |
226
|
|
|
} |
227
|
|
|
|