You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oas.md
+37-30Lines changed: 37 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -3447,7 +3447,7 @@ See examples for expected behavior.
3447
3447
3448
3448
| Field Name | Type | Description |
3449
3449
| ---- | :----: | ---- |
3450
-
| <a name="xml-name"></a>name | `string` | 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. |
3450
+
| <a name="xml-name"></a>name | `string` | Replaces the inferred name of the element/attribute used for the described schema property. For the root schema object of a [schema component](#components-schemas), the inferred name is the name of the component; for other schemas the name is inferred from the parent property name. 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. |
3451
3451
| <a name="xml-namespace"></a>namespace | `string` | The URI of the namespace definition. Value MUST be in the form of a non-relative URI. |
3452
3452
| <a name="xml-prefix"></a>prefix | `string` | The prefix to be used for the [name](#xml-name). |
3453
3453
| <a name="xml-attribute"></a>attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. |
@@ -3539,25 +3539,30 @@ animals:
3539
3539
3540
3540
###### XML Attribute, Prefix and Namespace
3541
3541
3542
-
In this example, a full model definition is shown.
3542
+
In this example, a full [schema component](#components-schemas) definition is shown.
3543
+
Note that the name of the root XML element comes from the component name.
3543
3544
3544
3545
```json
3545
3546
{
3546
-
"Person": {
3547
-
"type": "object",
3548
-
"properties": {
3549
-
"id": {
3550
-
"type": "integer",
3551
-
"format": "int32",
3552
-
"xml": {
3553
-
"attribute": true
3554
-
}
3555
-
},
3556
-
"name": {
3557
-
"type": "string",
3558
-
"xml": {
3559
-
"namespace": "https://example.com/schema/sample",
3560
-
"prefix": "sample"
3547
+
"components": {
3548
+
"schemas": {
3549
+
"Person": {
3550
+
"type": "object",
3551
+
"properties": {
3552
+
"id": {
3553
+
"type": "integer",
3554
+
"format": "int32",
3555
+
"xml": {
3556
+
"attribute": true
3557
+
}
3558
+
},
3559
+
"name": {
3560
+
"type": "string",
3561
+
"xml": {
3562
+
"namespace": "https://example.com/schema/sample",
3563
+
"prefix": "sample"
3564
+
}
3565
+
}
3561
3566
}
3562
3567
}
3563
3568
}
@@ -3566,19 +3571,21 @@ In this example, a full model definition is shown.
0 commit comments