-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXml.php
More file actions
134 lines (121 loc) · 4.73 KB
/
Xml.php
File metadata and controls
134 lines (121 loc) · 4.73 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
<?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.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#xml-object
* @link https://github.com/zero-to-prod/data-model-openapi30
* DataModels for OpenAPI 3.0.*
*/
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.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $name
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
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.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
#[Describe(['nullable'])]
public ?string $name;
/**
* The URI of the namespace definition. Value _MUST_ be in the form of a non-relative URI.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $namespace
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
public const namespace = 'namespace';
/**
* The URI of the namespace definition. Value _MUST_ be in the form of a non-relative URI.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
#[Describe(['nullable'])]
public ?string $namespace;
/**
* The prefix to be used for the name.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $prefix
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
public const prefix = 'prefix';
/**
* The prefix to be used for the name.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
#[Describe(['nullable'])]
public ?string $prefix;
/**
* Declares whether the property definition translates to an attribute
* instead of an element. Default value is `false`.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $attribute
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
public const attribute = 'attribute';
/**
* Declares whether the property definition translates to an attribute
* instead of an element. Default value is `false`.
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
#[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`).
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @see $wrapped
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
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`).
*
* @see https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-22
* @link https://github.com/zero-to-prod/data-model-openapi30
*/
#[Describe(['default' => false])]
public bool $wrapped;
}