Skip to content

Commit d4ae1dd

Browse files
committed
Fix XML namespace syntax
The XML Object's namespace field was changed from "URL" to "absolute URI" because relative references in a namespace are deprecated by XML, and the base URI to use for resolving them in the context of an OpenAPI Description is unclear. However, XML namespaces can include fragments, and the correct term is "non-relative URI" rather than "absolute URI" which forbids fragments. This change includes additional guidance on how XML usage and the requirements of this specification do not quite align.
1 parent eec1906 commit d4ae1dd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

versions/3.0.4.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3183,13 +3183,19 @@ See examples for expected behavior.
31833183
Field Name | Type | Description
31843184
---|:---:|---
31853185
<a name="xmlName"></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 and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
3186-
<a name="xmlNamespace"></a>namespace | `string` | The URI of the namespace definition. Value MUST be in the form of an absolute URI.
3186+
<a name="xmlNamespace"></a>namespace | `string` | The URI of the namespace definition. Value MUST be in the form of a non-relative URI.
31873187
<a name="xmlPrefix"></a>prefix | `string` | The prefix to be used for the [name](#xmlName).
31883188
<a name="xmlAttribute"></a>attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
31893189
<a name="xmlWrapped"></a>wrapped | `boolean` | 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`).
31903190

31913191
This object MAY be extended with [Specification Extensions](#specificationExtensions).
31923192

3193+
The `namespace` keyword is intended to match the syntax of [XML namespaces](https://www.w3.org/TR/xml-names11/), although there are a few caveats:
3194+
3195+
* Version 3.0.3 and earlier of this specification erroneously used the term "absolute URI" instead of "non-relative URI", so authors using namespaces that include a fragment should check tooling support carefully.
3196+
* XML allows but discourages relative URI-references, while this specification outright forbids them.
3197+
* XML 1.1 allows IRIs ([RFC3987](https://datatracker.ietf.org/doc/html/rfc3987)) as namespaces, and specifies that namespaces are compared without any encoding or decoding, which means that IRIs encoded to meet this specification's URI syntax requirement cannot be compared to IRIs as-is.
3198+
31933199
##### XML Object Examples
31943200

31953201
Each of the following examples represent the value of the `properties` keyword in a [Schema Object](#schemaObject) that is omitted for brevity.

0 commit comments

Comments
 (0)