|
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 JsonBasicSchema; |
|
11
|
|
|
use Swaggest\JsonSchema\Structure\ClassStructure; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
class PathItem extends ClassStructure { |
|
15
|
|
|
/** @var string */ |
|
16
|
|
|
public $ref; |
|
17
|
|
|
|
|
18
|
|
|
/** @var Operation */ |
|
19
|
|
|
public $get; |
|
20
|
|
|
|
|
21
|
|
|
/** @var Operation */ |
|
22
|
|
|
public $put; |
|
23
|
|
|
|
|
24
|
|
|
/** @var Operation */ |
|
25
|
|
|
public $post; |
|
26
|
|
|
|
|
27
|
|
|
/** @var Operation */ |
|
28
|
|
|
public $delete; |
|
29
|
|
|
|
|
30
|
|
|
/** @var Operation */ |
|
31
|
|
|
public $options; |
|
32
|
|
|
|
|
33
|
|
|
/** @var Operation */ |
|
34
|
|
|
public $head; |
|
35
|
|
|
|
|
36
|
|
|
/** @var Operation */ |
|
37
|
|
|
public $patch; |
|
38
|
|
|
|
|
39
|
|
|
/** @var BodyParameter[]|HeaderParameterSubSchema[]|FormDataParameterSubSchema[]|QueryParameterSubSchema[]|PathParameterSubSchema[]|JsonReference[]|array The parameters needed to send a valid API call. */ |
|
40
|
|
|
public $parameters; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param Properties|static $properties |
|
44
|
|
|
* @param JsonBasicSchema $ownerSchema |
|
45
|
|
|
*/ |
|
46
|
|
|
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema) |
|
47
|
|
|
{ |
|
48
|
|
|
$properties->ref = JsonBasicSchema::string(); |
|
49
|
|
|
$ownerSchema->addPropertyMapping('$ref', self::names()->ref); |
|
|
|
|
|
|
50
|
|
|
$properties->get = Operation::schema(); |
|
51
|
|
|
$properties->put = Operation::schema(); |
|
52
|
|
|
$properties->post = Operation::schema(); |
|
53
|
|
|
$properties->delete = Operation::schema(); |
|
54
|
|
|
$properties->options = Operation::schema(); |
|
55
|
|
|
$properties->head = Operation::schema(); |
|
56
|
|
|
$properties->patch = Operation::schema(); |
|
57
|
|
|
$properties->parameters = JsonBasicSchema::arr(); |
|
58
|
|
|
$properties->parameters->items = new JsonBasicSchema(); |
|
59
|
|
|
$properties->parameters->items->oneOf[0] = new JsonBasicSchema(); |
|
60
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[0] = BodyParameter::schema(); |
|
61
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1] = JsonBasicSchema::object(); |
|
62
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1]->oneOf[0] = HeaderParameterSubSchema::schema(); |
|
63
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1]->oneOf[1] = FormDataParameterSubSchema::schema(); |
|
64
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1]->oneOf[2] = QueryParameterSubSchema::schema(); |
|
65
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1]->oneOf[3] = PathParameterSubSchema::schema(); |
|
66
|
|
|
$properties->parameters->items->oneOf[0]->oneOf[1]->required = array ( |
|
67
|
|
|
0 => 'name', |
|
68
|
|
|
1 => 'in', |
|
69
|
|
|
2 => 'type', |
|
70
|
|
|
); |
|
71
|
|
|
$properties->parameters->items->oneOf[1] = JsonReference::schema(); |
|
72
|
|
|
$properties->parameters->description = 'The parameters needed to send a valid API call.'; |
|
|
|
|
|
|
73
|
|
|
$properties->parameters->uniqueItems = true; |
|
74
|
|
|
$ownerSchema->type = 'object'; |
|
|
|
|
|
|
75
|
|
|
$ownerSchema->additionalProperties = false; |
|
76
|
|
|
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema(); |
|
77
|
|
|
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.'; |
|
|
|
|
|
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
|
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.