Skip to content

Commit 5ca7a28

Browse files
committed
Discriminator: Cleanup intro description
This language seems to describe the value of the `discriminator` keyword to be an "object name" (whatever that means) rather than an object.
1 parent 72cba92 commit 5ca7a28

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

versions/3.1.1.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,8 @@ The OpenAPI Specification's base vocabulary is comprised of the following keywor
23322332

23332333
Field Name | Type | Description
23342334
---|:---:|---
2335-
<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.
2335+
<a name="schemaDiscriminator"></a>discriminator | [Discriminator
2336+
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.
23362337
<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.
23372338
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
23382339
<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.<br><br>**Deprecated:** The `example` property has been deprecated in favor of the JSON Schema `examples` keyword. Use of `example` is discouraged, and later versions of this specification may remove it.
@@ -2346,8 +2347,8 @@ The OpenAPI Specification allows combining and extending model definitions using
23462347

23472348
While composition offers model extensibility, it does not imply a hierarchy between the models.
23482349
To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
2349-
When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
2350-
As such, the `discriminator` field MUST be a required field.
2350+
When used, the `discriminator` will indicate the name of the property that decides which schema definition validates the structure of the model.
2351+
As such, that property MUST be a required field.
23512352
There are two ways to define the value of a discriminator for an inheriting instance.
23522353
- Use the schema name.
23532354
- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.

0 commit comments

Comments
 (0)