| 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 |
* @see [XML Object](https://spec.openapis.org/oas/v3.1.1.html#xml-object) |
| 13 |
* |
| 14 |
* @Annotation |
| 15 |
*/ |
| 16 |
class Xml extends AbstractAnnotation |
| 17 |
{ |
| 18 |
/** |
| 19 |
* Replaces the name of the element/attribute used for the described schema property. |
| 20 |
* |
| 21 |
* When defined within the Items Object (items), it will affect the name of the individual XML elements within the list. |
| 22 |
* When defined alongside type being array (outside the items), it will affect the wrapping element |
| 23 |
* and only if wrapped is <code>true</code>. |
| 24 |
* |
| 25 |
* If wrapped is <code>false</code>, it will be ignored. |
| 26 |
* |
| 27 |
* @var string |
| 28 |
*/ |
| 29 |
public $name = Generator::UNDEFINED; |
| 30 |
|
| 31 |
/** |
| 32 |
* The URL of the namespace definition. Value SHOULD be in the form of a URL. |
| 33 |
* |
| 34 |
* @var string |
| 35 |
*/ |
| 36 |
public $namespace = Generator::UNDEFINED; |
| 37 |
|
| 38 |
/** |
| 39 |
* The prefix to be used for the name. |
| 40 |
* |
| 41 |
* @var string |
| 42 |
*/ |
| 43 |
public $prefix = Generator::UNDEFINED; |
| 44 |
|
| 45 |
/** |
| 46 |
* Declares whether the property definition translates to an attribute instead of an element. |
| 47 |
* |
| 48 |
* Default value is <code>false</code>. |
| 49 |
* |
| 50 |
* @var bool |
| 51 |
*/ |
| 52 |
public $attribute = Generator::UNDEFINED; |
| 53 |
|
| 54 |
/** |
| 55 |
* MAY be used only for an array definition. |
| 56 |
* |
| 57 |
* Signifies whether the array is wrapped (for example <code><books><book/><book/></books></code>) |
| 58 |
* or unwrapped (<code><book/><book/></code>). |
| 59 |
* |
| 60 |
* Default value is false. The definition takes effect only when defined alongside type being array (outside the items). |
| 61 |
* |
| 62 |
* @var bool |
| 63 |
*/ |
| 64 |
public $wrapped = Generator::UNDEFINED; |
| 65 |
|
| 66 |
/** |
| 67 |
* @inheritdoc |
| 68 |
*/ |
| 69 |
public static $_types = [ |
| 70 |
'name' => 'string', |
| 71 |
'namespace' => 'string', |
| 72 |
'prefix' => 'string', |
| 73 |
'attribute' => 'boolean', |
| 74 |
'wrapped' => 'boolean', |
| 75 |
]; |
| 76 |
|
| 77 |
/** |
| 78 |
* @inheritdoc |
| 79 |
*/ |
| 80 |
public static $_parents = [ |
| 81 |
AdditionalProperties::class, |
| 82 |
Schema::class, |
| 83 |
Property::class, |
| 84 |
Schema::class, |
| 85 |
Items::class, |
| 86 |
XmlContent::class, |
| 87 |
]; |
| 88 |
|
| 89 |
/** |
| 90 |
* @inheritdoc |
| 91 |
*/ |
| 92 |
public static $_nested = [ |
| 93 |
Attachable::class => ['attachables'], |
| 94 |
]; |
| 95 |
} |