edit Discriminator Object
MODIFY
versions/3.0.md
versions/3.0.md
@@ -2859,7 +2859,7 @@ components:
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. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
-Note, when using the discriminator, _inline_ schemas will not be considered when using the discriminator.
+Note, when using the discriminator, _inline_ schemas will not be considered.
##### Fixed Fields
Field Name | Type | Description
@@ -2879,7 +2879,7 @@ MyResponseType:
- $ref: '#/components/schemas/Lizard'
```
-which means the paylod _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:
+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:
```
@@ -2919,11 +2919,11 @@ MyResponseType:
monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
```
-Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match a implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Note, mapping keys MUST be string values, but tooling MAY response values to strings for comparison.
+Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY map response values to strings for comparison.
When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
-In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas composing the parent schema in an `allOf` construct may be used as an alternate schema.
+In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. 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.
For example:
@@ -2967,7 +2967,7 @@ components:
type: boolean
```
-a payload like this:
+having a payload like this:
```
{

edit Discriminator Object