Debian Codegraph @

vendor/zircote/swagger-php/src/Annotations/Examples.php

raw
1 <?php declare(strict_types=1);
2
3 /**
4 * @license Apache 2.0
5 */
6
7 namespace OpenApi\Annotations;
8
9 use OpenApi\Generator;
10
11 /**
12 * @Annotation
13 */
14 class Examples extends AbstractAnnotation
15 {
16 /**
17 * The relative or absolute path to an example.
18 *
19 * @see [Reference Object](https://spec.openapis.org/oas/v3.1.1.html#reference-object)
20 *
21 * @var string|class-string|object
22 */
23 public $ref = Generator::UNDEFINED;
24
25 /**
26 * The key into <code>#/components/examples</code>.
27 *
28 * @var string
29 */
30 public $example = Generator::UNDEFINED;
31
32 /**
33 * Short description for the example.
34 *
35 * @var string
36 */
37 public $summary = Generator::UNDEFINED;
38
39 /**
40 * Embedded literal example.
41 *
42 * The value field and externalValue field are mutually exclusive.
43 *
44 * To represent examples of media types that cannot naturally be represented
45 * in JSON or YAML, use a string value to contain the example, escaping where necessary.
46 *
47 * @var string
48 */
49 public $description = Generator::UNDEFINED;
50
51 /**
52 * Embedded literal example.
53 *
54 * The value field and externalValue field are mutually exclusive.
55 *
56 * To represent examples of media types that cannot naturally be represented
57 * in JSON or YAML, use a string value to contain the example, escaping where necessary.
58 *
59 * @var int|string|array
60 */
61 public $value = Generator::UNDEFINED;
62
63 /**
64 * An URL that points to the literal example.
65 *
66 * This provides the capability to reference examples that cannot easily be included
67 * in JSON or YAML documents.
68 *
69 * The value field and externalValue field are mutually exclusive.
70 *
71 * @var string
72 */
73 public $externalValue = Generator::UNDEFINED;
74
75 public static $_types = [
76 'summary' => 'string',
77 'description' => 'string',
78 'externalValue' => 'string',
79 ];
80
81 public static $_required = ['summary'];
82
83 public static $_parents = [
84 AdditionalProperties::class,
85 Components::class,
86 Items::class,
87 Schema::class,
88 Parameter::class,
89 PathParameter::class,
90 Property::class,
91 MediaType::class,
92 JsonContent::class,
93 XmlContent::class,
94 ];
95
96 /**
97 * @inheritdoc
98 */
99 public static $_nested = [
100 Attachable::class => ['attachables'],
101 ];
102 }