Skip to content

Commit 63d56f5

Browse files
committed
More wording improvements for discriminator.
1 parent 0bb7541 commit 63d56f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

versions/3.0.4.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,8 +2734,7 @@ components:
27342734
27352735
#### <a name="discriminatorObject"></a>Discriminator Object
27362736
2737-
When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object can be used to aid in serialization, deserialization, and validation.
2738-
It does this by implicitly or explicitly associating the possible values of a named property with alternative schemas.
2737+
When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object can be used to aid in serialization, deserialization, and validation by implicitly or explicitly associating the possible values of a named property with alternative schemas.
27392738
27402739
##### Fixed Fields
27412740
Field Name | Type | Description
@@ -2746,9 +2745,9 @@ Field Name | Type | Description
27462745
##### Conditions for Using the Discriminator Object
27472746
The Discriminator Object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
27482747
In both the `oneOf` and `anyOf` use cases, where those keywords are adjacent to `discriminator`, all possible schemas MUST be listed explicitly.
2749-
To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an `allOf` construct may be used as an alternate schema.
2750-
It is implementation-defined as to whether all named [Schema Objects](#schemaObject) under the [Components Object](#componentsObject), or only those that are otherwise directly referenced are searched for matching `allOf` references.
2751-
However, it is RECOMMENDED to search all named schemas in the Components Object because it is common with the `allOf` usage for other parts of the API to only directly reference the parent schema (that contains the `discriminator`).
2748+
To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas building on the parent schema via an `allOf` construct may be used as an alternate schema.
2749+
It is implementation-defined as to whether all named [Schema Objects](#schemaObject) under the [Components Object](#componentsObject), or only those that are otherwise directly referenced are searched for `allOf` references to the parent schema.
2750+
However, it is RECOMMENDED to search all named schemas in the Components Object because it is common with the `allOf` usage for other parts of the API to only directly reference the parent schema.
27522751

27532752
The behavior of any configuration of `oneOf`, `anyOf`, `allOf` and `discriminator` that is not described above is undefined.
27542753

0 commit comments

Comments
 (0)