|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @file ATTENTION!!! The code below was carefully crafted by a mean machine. |
|
4
|
|
|
* Please consider to NOT put any emotional human-generated modifications as AI will throw them away with no mercy. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Swaggest\JsonSchema\SwaggerSchema; |
|
8
|
|
|
|
|
9
|
|
|
use Swaggest\JsonSchema\Constraint\Properties; |
|
10
|
|
|
use Swaggest\JsonSchema\Schema as Schema1; |
|
11
|
|
|
use Swaggest\JsonSchema\Structure\ClassStructure; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
class Schema extends ClassStructure { |
|
15
|
|
|
/** @var string */ |
|
16
|
|
|
public $ref; |
|
17
|
|
|
|
|
18
|
|
|
/** @var string */ |
|
19
|
|
|
public $format; |
|
20
|
|
|
|
|
21
|
|
|
/** @var string */ |
|
22
|
|
|
public $title; |
|
23
|
|
|
|
|
24
|
|
|
/** @var string */ |
|
25
|
|
|
public $description; |
|
26
|
|
|
|
|
27
|
|
|
public $default; |
|
28
|
|
|
|
|
29
|
|
|
/** @var float */ |
|
30
|
|
|
public $multipleOf; |
|
31
|
|
|
|
|
32
|
|
|
/** @var float */ |
|
33
|
|
|
public $maximum; |
|
34
|
|
|
|
|
35
|
|
|
/** @var bool */ |
|
36
|
|
|
public $exclusiveMaximum; |
|
37
|
|
|
|
|
38
|
|
|
/** @var float */ |
|
39
|
|
|
public $minimum; |
|
40
|
|
|
|
|
41
|
|
|
/** @var bool */ |
|
42
|
|
|
public $exclusiveMinimum; |
|
43
|
|
|
|
|
44
|
|
|
/** @var int */ |
|
45
|
|
|
public $maxLength; |
|
46
|
|
|
|
|
47
|
|
|
/** @var int */ |
|
48
|
|
|
public $minLength; |
|
49
|
|
|
|
|
50
|
|
|
/** @var string */ |
|
51
|
|
|
public $pattern; |
|
52
|
|
|
|
|
53
|
|
|
/** @var int */ |
|
54
|
|
|
public $maxItems; |
|
55
|
|
|
|
|
56
|
|
|
/** @var int */ |
|
57
|
|
|
public $minItems; |
|
58
|
|
|
|
|
59
|
|
|
/** @var bool */ |
|
60
|
|
|
public $uniqueItems; |
|
61
|
|
|
|
|
62
|
|
|
/** @var int */ |
|
63
|
|
|
public $maxProperties; |
|
64
|
|
|
|
|
65
|
|
|
/** @var int */ |
|
66
|
|
|
public $minProperties; |
|
67
|
|
|
|
|
68
|
|
|
/** @var string[]|array */ |
|
69
|
|
|
public $required; |
|
70
|
|
|
|
|
71
|
|
|
/** @var array */ |
|
72
|
|
|
public $enum; |
|
73
|
|
|
|
|
74
|
|
|
/** @var Schema|bool */ |
|
75
|
|
|
public $additionalProperties; |
|
76
|
|
|
|
|
77
|
|
|
/** @var array */ |
|
78
|
|
|
public $type; |
|
79
|
|
|
|
|
80
|
|
|
/** @var Schema|Schema[]|array */ |
|
81
|
|
|
public $items; |
|
82
|
|
|
|
|
83
|
|
|
/** @var Schema[]|array */ |
|
84
|
|
|
public $allOf; |
|
85
|
|
|
|
|
86
|
|
|
/** @var Schema[] */ |
|
87
|
|
|
public $properties; |
|
88
|
|
|
|
|
89
|
|
|
/** @var string */ |
|
90
|
|
|
public $discriminator; |
|
91
|
|
|
|
|
92
|
|
|
/** @var bool */ |
|
93
|
|
|
public $readOnly; |
|
94
|
|
|
|
|
95
|
|
|
/** @var Xml */ |
|
96
|
|
|
public $xml; |
|
97
|
|
|
|
|
98
|
|
|
/** @var ExternalDocs information about external documentation */ |
|
99
|
|
|
public $externalDocs; |
|
100
|
|
|
|
|
101
|
|
|
public $example; |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param Properties|static $properties |
|
105
|
|
|
* @param Schema1 $ownerSchema |
|
106
|
|
|
*/ |
|
107
|
|
|
public static function setUpProperties($properties, Schema1 $ownerSchema) |
|
108
|
|
|
{ |
|
109
|
|
|
$properties->ref = Schema1::string(); |
|
110
|
|
|
$ownerSchema->addPropertyMapping('$ref', self::names()->ref); |
|
|
|
|
|
|
111
|
|
|
$properties->format = Schema1::string(); |
|
112
|
|
|
$properties->title = Schema1::string(); |
|
113
|
|
|
$properties->description = Schema1::string(); |
|
114
|
|
|
$properties->default = new Schema1(); |
|
115
|
|
|
$properties->multipleOf = Schema1::number(); |
|
116
|
|
|
$properties->multipleOf->minimum = 0; |
|
117
|
|
|
$properties->multipleOf->exclusiveMinimum = true; |
|
118
|
|
|
$properties->maximum = Schema1::number(); |
|
119
|
|
|
$properties->exclusiveMaximum = Schema1::boolean(); |
|
120
|
|
|
$properties->exclusiveMaximum->default = false; |
|
|
|
|
|
|
121
|
|
|
$properties->minimum = Schema1::number(); |
|
122
|
|
|
$properties->exclusiveMinimum = Schema1::boolean(); |
|
123
|
|
|
$properties->exclusiveMinimum->default = false; |
|
|
|
|
|
|
124
|
|
|
$properties->maxLength = Schema1::integer(); |
|
125
|
|
|
$properties->maxLength->minimum = 0; |
|
126
|
|
|
$properties->minLength = new Schema1(); |
|
127
|
|
|
$properties->minLength->allOf[0] = Schema1::integer(); |
|
128
|
|
|
$properties->minLength->allOf[0]->minimum = 0; |
|
129
|
|
|
$properties->minLength->allOf[1] = new Schema1(); |
|
130
|
|
|
$properties->minLength->allOf[1]->default = 0; |
|
|
|
|
|
|
131
|
|
|
$properties->pattern = Schema1::string(); |
|
132
|
|
|
$properties->pattern->format = 'regex'; |
|
133
|
|
|
$properties->maxItems = Schema1::integer(); |
|
134
|
|
|
$properties->maxItems->minimum = 0; |
|
135
|
|
|
$properties->minItems = new Schema1(); |
|
136
|
|
|
$properties->minItems->allOf[0] = Schema1::integer(); |
|
137
|
|
|
$properties->minItems->allOf[0]->minimum = 0; |
|
138
|
|
|
$properties->minItems->allOf[1] = new Schema1(); |
|
139
|
|
|
$properties->minItems->allOf[1]->default = 0; |
|
|
|
|
|
|
140
|
|
|
$properties->uniqueItems = Schema1::boolean(); |
|
141
|
|
|
$properties->uniqueItems->default = false; |
|
|
|
|
|
|
142
|
|
|
$properties->maxProperties = Schema1::integer(); |
|
143
|
|
|
$properties->maxProperties->minimum = 0; |
|
144
|
|
|
$properties->minProperties = new Schema1(); |
|
145
|
|
|
$properties->minProperties->allOf[0] = Schema1::integer(); |
|
146
|
|
|
$properties->minProperties->allOf[0]->minimum = 0; |
|
147
|
|
|
$properties->minProperties->allOf[1] = new Schema1(); |
|
148
|
|
|
$properties->minProperties->allOf[1]->default = 0; |
|
|
|
|
|
|
149
|
|
|
$properties->required = Schema1::arr(); |
|
150
|
|
|
$properties->required->items = Schema1::string(); |
|
151
|
|
|
$properties->required->minItems = 1; |
|
152
|
|
|
$properties->required->uniqueItems = true; |
|
153
|
|
|
$properties->enum = Schema1::arr(); |
|
154
|
|
|
$properties->enum->minItems = 1; |
|
155
|
|
|
$properties->enum->uniqueItems = true; |
|
156
|
|
|
$properties->additionalProperties = new Schema1(); |
|
157
|
|
|
$properties->additionalProperties->anyOf[0] = Schema::schema(); |
|
158
|
|
|
$properties->additionalProperties->anyOf[1] = Schema1::boolean(); |
|
159
|
|
|
$properties->additionalProperties->default = new \stdClass(); |
|
|
|
|
|
|
160
|
|
|
$properties->type = new Schema1(); |
|
161
|
|
|
$properties->type->anyOf[0] = new Schema1(); |
|
162
|
|
|
$properties->type->anyOf[0]->enum = array ( |
|
163
|
|
|
0 => 'array', |
|
164
|
|
|
1 => 'boolean', |
|
165
|
|
|
2 => 'integer', |
|
166
|
|
|
3 => 'null', |
|
167
|
|
|
4 => 'number', |
|
168
|
|
|
5 => 'object', |
|
169
|
|
|
6 => 'string', |
|
170
|
|
|
); |
|
171
|
|
|
$properties->type->anyOf[1] = Schema1::arr(); |
|
172
|
|
|
$properties->type->anyOf[1]->items = new Schema1(); |
|
173
|
|
|
$properties->type->anyOf[1]->items->enum = array ( |
|
174
|
|
|
0 => 'array', |
|
175
|
|
|
1 => 'boolean', |
|
176
|
|
|
2 => 'integer', |
|
177
|
|
|
3 => 'null', |
|
178
|
|
|
4 => 'number', |
|
179
|
|
|
5 => 'object', |
|
180
|
|
|
6 => 'string', |
|
181
|
|
|
); |
|
182
|
|
|
$properties->type->anyOf[1]->minItems = 1; |
|
183
|
|
|
$properties->type->anyOf[1]->uniqueItems = true; |
|
184
|
|
|
$properties->items = new Schema1(); |
|
185
|
|
|
$properties->items->anyOf[0] = Schema::schema(); |
|
186
|
|
|
$properties->items->anyOf[1] = Schema1::arr(); |
|
187
|
|
|
$properties->items->anyOf[1]->items = Schema::schema(); |
|
188
|
|
|
$properties->items->anyOf[1]->minItems = 1; |
|
189
|
|
|
$properties->items->default = new \stdClass(); |
|
|
|
|
|
|
190
|
|
|
$properties->allOf = Schema1::arr(); |
|
191
|
|
|
$properties->allOf->items = Schema::schema(); |
|
192
|
|
|
$properties->allOf->minItems = 1; |
|
193
|
|
|
$properties->properties = Schema1::object(); |
|
194
|
|
|
$properties->properties->additionalProperties = Schema::schema(); |
|
195
|
|
|
$properties->properties->default = new \stdClass(); |
|
|
|
|
|
|
196
|
|
|
$properties->discriminator = Schema1::string(); |
|
197
|
|
|
$properties->readOnly = Schema1::boolean(); |
|
198
|
|
|
$properties->readOnly->default = false; |
|
|
|
|
|
|
199
|
|
|
$properties->xml = Xml::schema(); |
|
200
|
|
|
$properties->externalDocs = ExternalDocs::schema(); |
|
201
|
|
|
$properties->example = new Schema1(); |
|
202
|
|
|
$ownerSchema->type = 'object'; |
|
|
|
|
|
|
203
|
|
|
$ownerSchema->additionalProperties = false; |
|
204
|
|
|
$ownerSchema->patternProperties['^x-'] = new Schema1(); |
|
205
|
|
|
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.'; |
|
|
|
|
|
|
206
|
|
|
$ownerSchema->description = 'A deterministic version of a JSON Schema object.'; |
|
|
|
|
|
|
207
|
|
|
} |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
|
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.