Skip to content

Commit cccd70b

Browse files
committed
Use "discriminating value" consistently
I found the "discriminator value" language confusing, because `discriminator` is the field name, and in most cases the value of a field is the value in the OpenAPI Description. Reviewers did not like "discriminator property value", but "discriminating value" makes it clear that this is about the value that actually causes schema selection, and not about the value of the discriminator keyword. Also removed placeholder in favor of just having the headings, as has been done in several other PRs that overlap with new section PRs for internal linking.
1 parent cda2ba7 commit cccd70b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

versions/3.2.0.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `op
155155

156156
#### <a name="resolvingImplicitConnections"></a>Resolving Implicit Connections
157157

158-
***TODO: In another PR***
159-
160158
### <a name="dataTypes"></a>Data Types
161159

162160
Data types in the OAS are based on the types supported by the [JSON Schema Specification Draft 2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-4.2.1).
@@ -2675,7 +2673,7 @@ components:
26752673
]
26762674
},
26772675
"Cat": {
2678-
"description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
2676+
"description": "A representation of a cat. Note that `Cat` will be used as the discriminating value.",
26792677
"allOf": [
26802678
{
26812679
"$ref": "#/components/schemas/Pet"
@@ -2702,7 +2700,7 @@ components:
27022700
]
27032701
},
27042702
"Dog": {
2705-
"description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
2703+
"description": "A representation of a dog. Note that `Dog` will be used as the discriminating value.",
27062704
"allOf": [
27072705
{
27082706
"$ref": "#/components/schemas/Pet"
@@ -2744,7 +2742,7 @@ components:
27442742
required:
27452743
- name
27462744
- petType
2747-
Cat: # "Cat" will be used as the discriminator value
2745+
Cat: # "Cat" will be used as the discriminating value
27482746
description: A representation of a cat
27492747
allOf:
27502748
- $ref: '#/components/schemas/Pet'
@@ -2760,7 +2758,7 @@ components:
27602758
- aggressive
27612759
required:
27622760
- huntingSkill
2763-
Dog: # "Dog" will be used as the discriminator value
2761+
Dog: # "Dog" will be used as the discriminating value
27642762
description: A representation of a dog
27652763
allOf:
27662764
- $ref: '#/components/schemas/Pet'
@@ -2898,7 +2896,7 @@ The Discriminator Object does this by implicitly or explicitly associating the p
28982896
##### Fixed Fields
28992897
Field Name | Type | Description
29002898
---|:---:|---
2901-
<a name="propertyName"></a>propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value. This property SHOULD be required in the payload schema, as the behavior when the property is absent is undefined.
2899+
<a name="propertyName"></a>propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminating value. This property SHOULD be required in the payload schema, as the behavior when the property is absent is undefined.
29022900
<a name="discriminatorMapping"></a> mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references.
29032901

29042902
This object MAY be extended with [Specification Extensions](#specificationExtensions).
@@ -2974,7 +2972,7 @@ MyResponseType:
29742972
monster: https://gigantic-server.com/schemas/Monster/schema.json
29752973
```
29762974

2977-
Here the discriminator property _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `#/components/schemas/dog`. If the discriminator property _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail.
2975+
Here the discriminating value of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `#/components/schemas/dog`. If the discriminating value does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail.
29782976

29792977
When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
29802978

0 commit comments

Comments
 (0)