-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXml.php
122 lines (109 loc) · 4 KB
/
Xml.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
namespace Zerotoprod\DataModelOpenapi30;
use Zerotoprod\DataModel\Describe;
use Zerotoprod\DataModelOpenapi30\Helpers\DataModel;
/**
* A metadata object that allows for more fine-tuned XML model definitions.
*
* When using arrays, XML element names are not inferred (for singular/plural
* forms) and the name field _SHOULD_ be used to add that information.
* See examples for expected behavior.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#xml-object
*/
class Xml
{
use DataModel;
/**
* Replaces the name of the element/attribute used for the described
* schema property. When defined within `items`, it will affect the
* name of the individual XML elements within the list. When
* defined alongside `type` being `"array"` (outside the
* `items`), it will affect the wrapping element if and
* only if `wrapped` is `true`. If `wrapped` is `false`,
* it will be ignored.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $name
*/
public const name = 'name';
/**
* Replaces the name of the element/attribute used for the described
* schema property. When defined within `items`, it will affect the
* name of the individual XML elements within the list. When
* defined alongside `type` being `"array"` (outside the
* `items`), it will affect the wrapping element if and
* only if `wrapped` is `true`. If `wrapped` is `false`,
* it will be ignored.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
*/
#[Describe(['nullable'])]
public ?string $name;
/**
* The URI of the namespace definition. Value _MUST_ be in the form of a non-relative URI.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $namespace
*/
public const namespace = 'namespace';
/**
* The URI of the namespace definition. Value _MUST_ be in the form of a non-relative URI.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
*/
#[Describe(['nullable'])]
public ?string $namespace;
/**
* The prefix to be used for the name.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $prefix
*/
public const prefix = 'prefix';
/**
* The prefix to be used for the name.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
*/
#[Describe(['nullable'])]
public ?string $prefix;
/**
* Declares whether the property definition translates to an attribute
* instead of an element. Default value is `false`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $attribute
*/
public const attribute = 'attribute';
/**
* Declares whether the property definition translates to an attribute
* instead of an element. Default value is `false`.
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
*/
#[Describe(['default' => false])]
public bool $attribute;
/**
* _MAY_ be used only for an array definition. Signifies whether the
* array is wrapped (for example, `<books><book/><book/></books>`) or
* unwrapped (`<book/><book/>`). Default value is `false`. The
* definition takes effect only when defined alongside `type`
* being `"array"` (outside the `items`).
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $wrapped
*/
public const wrapped = 'wrapped';
/**
* _MAY_ be used only for an array definition. Signifies whether the
* array is wrapped (for example, `<books><book/><book/></books>`) or
* unwrapped (`<book/><book/>`). Default value is `false`. The
* definition takes effect only when defined alongside `type`
* being `"array"` (outside the `items`).
*
* @link https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
*/
#[Describe(['default' => false])]
public bool $wrapped;
}