Skip to content

Commit 5802ec8

Browse files
authored
Merge pull request #3954 from ralfhandl/v3.0.4/sync-with-3.1.1
Align 3.0.4 with 3.1.1
2 parents d56b266 + c0696c1 commit 5802ec8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

versions/3.0.4.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,8 @@ However, if all three of `style`, `explode`, and `allowReserved` fields are abse
16491649
* All three keywords are to be entirely ignored, rather than treated as having their default values
16501650
* Encoding is to be based on `contentType` alone, whether it is present with an explicit value or absent and treated as having its default value
16511651

1652-
This makes the presence of at least one of `style`, `explode`, or `allowReserved` with an explicit value equivalent to using `schema` with `in: query` Parameter Objects, and their absence the equivalent of using `content`, but with the media type specified in `contentType` rather than through a Media Type Object.
1652+
Note that the presence of at least one of `style`, `explode`, or `allowReserved` with an explicit value is equivalent to using `schema` with `in: query` Parameter Objects.
1653+
The absence of all three of those fields is the equivalent of using `content`, but with the media type specified in `contentType` rather than through a Media Type Object.
16531654

16541655
##### Encoding the `x-www-form-urlencoded` Media Type
16551656

@@ -1998,9 +1999,9 @@ Plain text response with headers:
19981999
"content": {
19992000
"text/plain": {
20002001
"schema": {
2001-
"type": "string",
2002-
"example": "whoa!"
2003-
}
2002+
"type": "string"
2003+
},
2004+
"example": "whoa!"
20042005
}
20052006
},
20062007
"headers": {
@@ -2681,7 +2682,7 @@ These types can be objects, but also primitives and arrays.
26812682
This object is an extended subset of the [JSON Schema Specification Wright Draft 00](https://json-schema.org/).
26822683

26832684
For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-wright-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-wright-json-schema-validation-00).
2684-
Unless stated otherwise, the property definitions follow the JSON Schema.
2685+
Unless stated otherwise, the property definitions follow those of JSON Schema and do not add any additional semantics.
26852686

26862687
##### Properties
26872688

@@ -2727,11 +2728,11 @@ Other than the JSON Schema subset fields, the following fields MAY be used for f
27272728
Field Name | Type | Description
27282729
---|:---:|---
27292730
<a name="schemaNullable"></a>nullable | `boolean` | A `true` value adds `"null"` to the allowed type specified by the `type` keyword, only if `type` is explicitly defined within the same Schema Object. Other Schema Object constraints retain their defined behavior, and therefore may disallow the use of `null` as a value. A `false` value leaves the specified or default `type` unmodified. The default value is `false`.
2730-
<a name="schemaDiscriminator"></a>discriminator | [Discriminator Object](#discriminatorObject) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#schemaComposition) for more details.
2731+
<a name="schemaDiscriminator"></a>discriminator | [Discriminator Object](#discriminatorObject) | Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See [Composition and Inheritance](#schemaComposition) for more details.
27312732
<a name="schemaReadOnly"></a>readOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
27322733
<a name="schemaWriteOnly"></a>writeOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
27332734
<a name="schemaXml"></a>xml | [XML Object](#xmlObject) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
2734-
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
2735+
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
27352736
<a name="schemaExample"></a>example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
27362737
<a name="schemaDeprecated"></a> deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
27372738

@@ -2740,11 +2741,11 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
27402741
###### <a name="schemaComposition"></a>Composition and Inheritance (Polymorphism)
27412742

27422743
The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
2743-
`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
2744+
`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
27442745

27452746
While composition offers model extensibility, it does not imply a hierarchy between the models.
27462747
To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
2747-
When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
2748+
When used, the `discriminator` indicates the name of the property that hints which schema definition is expected to validate the structure of the model.
27482749
As such, the `discriminator` field MUST be a required field.
27492750
There are two ways to define the value of a discriminator for an inheriting instance.
27502751
- Use the schema name.
@@ -3136,8 +3137,7 @@ MyResponseType:
31363137
- $ref: '#/components/schemas/Lizard'
31373138
```
31383139

3139-
which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:
3140-
3140+
which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. Deserialization of a `oneOf` can be a costly operation, as it requires determining which schema matches the payload and thus should be used in deserialization. This problem also exists for `anyOf` schemas. A `discriminator` MAY be used as a "hint" to improve the efficiency of selection of the matching schema. The `discriminator` field cannot change the validation result of the `oneOf`, it can only help make the deserialization more efficient and provide better error messaging. We can specify the exact field that tells us which schema is expected to match the instance:
31413141

31423142
```yaml
31433143
MyResponseType:
@@ -3261,7 +3261,7 @@ Field Name | Type | Description
32613261

32623262
This object MAY be extended with [Specification Extensions](#specificationExtensions).
32633263

3264-
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:
3264+
The `namespace` field is intended to match the syntax of [XML namespaces](https://www.w3.org/TR/xml-names11/), although there are a few caveats:
32653265

32663266
* 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.
32673267
* XML allows but discourages relative URI-references, while this specification outright forbids them.

0 commit comments

Comments
 (0)