Debian Codegraph @

vendor/zircote/swagger-php/src/Attributes/Property.php

raw
1 <?php declare(strict_types=1);
2
3 /**
4 * @license Apache 2.0
5 */
6
7 namespace OpenApi\Attributes;
8
9 use OpenApi\Annotations as OA;
10 use OpenApi\Generator;
11
12 #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE)]
13 class Property extends OA\Property
14 {
15 /**
16 * @param string|class-string|object|null $ref
17 * @param list<string> $required
18 * @param list<Property> $properties
19 * @param string|non-empty-array<string>|null $type
20 * @param array<Examples> $examples
21 * @param array<Schema|OA\Schema> $allOf
22 * @param array<Schema|OA\Schema> $anyOf
23 * @param array<Schema|OA\Schema> $oneOf
24 * @param list<string|int|float|bool|\UnitEnum|null>|class-string|null $enum
25 * @param array<string,mixed>|null $x
26 * @param list<Attachable>|null $attachables
27 */
28 public function __construct(
29 ?string $property = null,
30 ?Encoding $encoding = null,
31
32 // Schema
33 string|object|null $ref = null,
34 ?string $schema = null,
35 ?string $title = null,
36 ?string $description = Generator::UNDEFINED,
37 ?int $maxProperties = null,
38 ?int $minProperties = null,
39 ?array $required = null,
40 ?array $properties = null,
41 string|array|null $type = null,
42 ?string $format = null,
43 ?Items $items = null,
44 ?string $collectionFormat = null,
45 ?string $pattern = null,
46 ?Discriminator $discriminator = null,
47 ?bool $readOnly = null,
48 ?bool $writeOnly = null,
49 ?Xml $xml = null,
50 ?ExternalDocumentation $externalDocs = null,
51 mixed $example = Generator::UNDEFINED,
52 ?array $examples = null,
53 ?bool $nullable = null,
54 ?bool $deprecated = null,
55 ?array $allOf = null,
56 ?array $anyOf = null,
57 ?array $oneOf = null,
58 ?string $contentEncoding = null,
59 ?string $contentMediaType = null,
60
61 // JSON Schema
62 mixed $default = Generator::UNDEFINED,
63 int|float|null $maximum = null,
64 bool|int|float|null $exclusiveMaximum = null,
65 int|float|null $minimum = null,
66 bool|int|float|null $exclusiveMinimum = null,
67 int|null $maxLength = null,
68 int|null $minLength = null,
69 int|null $maxItems = null,
70 int|null $minItems = null,
71 bool|null $uniqueItems = null,
72 array|string|null $enum = null,
73 mixed $not = Generator::UNDEFINED,
74 bool|AdditionalProperties|null $additionalProperties = null,
75 array|null $additionalItems = null,
76 array|null $contains = null,
77 array|null $patternProperties = null,
78 array|null $unevaluatedProperties = null,
79 mixed $dependencies = Generator::UNDEFINED,
80 mixed $propertyNames = Generator::UNDEFINED,
81 mixed $const = Generator::UNDEFINED,
82
83 // abstract annotation
84 ?array $x = null,
85 ?array $attachables = null
86 ) {
87 parent::__construct([
88 'property' => $property ?? Generator::UNDEFINED,
89
90 // Schema
91 'ref' => $ref ?? Generator::UNDEFINED,
92 'schema' => $schema ?? Generator::UNDEFINED,
93 'title' => $title ?? Generator::UNDEFINED,
94 'description' => $description,
95 'maxProperties' => $maxProperties ?? Generator::UNDEFINED,
96 'minProperties' => $minProperties ?? Generator::UNDEFINED,
97 'required' => $required ?? Generator::UNDEFINED,
98 'properties' => $properties ?? Generator::UNDEFINED,
99 'type' => $type ?? Generator::UNDEFINED,
100 'format' => $format ?? Generator::UNDEFINED,
101 'collectionFormat' => $collectionFormat ?? Generator::UNDEFINED,
102 'pattern' => $pattern ?? Generator::UNDEFINED,
103 'readOnly' => $readOnly ?? Generator::UNDEFINED,
104 'writeOnly' => $writeOnly ?? Generator::UNDEFINED,
105 'xml' => $xml ?? Generator::UNDEFINED,
106 'example' => $example,
107 'nullable' => $nullable ?? Generator::UNDEFINED,
108 'deprecated' => $deprecated ?? Generator::UNDEFINED,
109 'allOf' => $allOf ?? Generator::UNDEFINED,
110 'anyOf' => $anyOf ?? Generator::UNDEFINED,
111 'oneOf' => $oneOf ?? Generator::UNDEFINED,
112 'contentEncoding' => $contentEncoding ?? Generator::UNDEFINED,
113 'contentMediaType' => $contentMediaType ?? Generator::UNDEFINED,
114
115 // JSON Schema
116 'default' => $default,
117 'maximum' => $maximum ?? Generator::UNDEFINED,
118 'exclusiveMaximum' => $exclusiveMaximum ?? Generator::UNDEFINED,
119 'minimum' => $minimum ?? Generator::UNDEFINED,
120 'exclusiveMinimum' => $exclusiveMinimum ?? Generator::UNDEFINED,
121 'maxLength' => $maxLength ?? Generator::UNDEFINED,
122 'minLength' => $minLength ?? Generator::UNDEFINED,
123 'maxItems' => $maxItems ?? Generator::UNDEFINED,
124 'minItems' => $minItems ?? Generator::UNDEFINED,
125 'uniqueItems' => $uniqueItems ?? Generator::UNDEFINED,
126 'enum' => $enum ?? Generator::UNDEFINED,
127 'not' => $not,
128 'additionalProperties' => $additionalProperties ?? Generator::UNDEFINED,
129 'additionalItems' => $additionalItems ?? Generator::UNDEFINED,
130 'contains' => $contains ?? Generator::UNDEFINED,
131 'patternProperties' => $patternProperties ?? Generator::UNDEFINED,
132 'unevaluatedProperties' => $unevaluatedProperties ?? Generator::UNDEFINED,
133 'dependencies' => $dependencies,
134 'propertyNames' => $propertyNames,
135 'const' => $const,
136
137 // abstract annotation
138 'x' => $x ?? Generator::UNDEFINED,
139 'attachables' => $attachables ?? Generator::UNDEFINED,
140 'value' => $this->combine($items, $discriminator, $externalDocs, $encoding, $examples),
141 ]);
142 }
143 }