Skip to content

Commit dd44da9

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 52bdba7 commit dd44da9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

versions/3.1.1.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ If the same JSON/YAML object is parsed multiple times and the respective context
193193

194194
#### <a name="resolvingImplicitConnections"></a>Resolving Implicit Connections
195195

196-
***TODO: In another PR***
197-
198196
### <a name="dataTypes"></a>Data Types
199197

200198
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).
@@ -2710,7 +2708,7 @@ components:
27102708
]
27112709
},
27122710
"Cat": {
2713-
"description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
2711+
"description": "A representation of a cat. Note that `Cat` will be used as the discriminating value.",
27142712
"allOf": [
27152713
{
27162714
"$ref": "#/components/schemas/Pet"
@@ -2737,7 +2735,7 @@ components:
27372735
]
27382736
},
27392737
"Dog": {
2740-
"description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
2738+
"description": "A representation of a dog. Note that `Dog` will be used as the discriminating value.",
27412739
"allOf": [
27422740
{
27432741
"$ref": "#/components/schemas/Pet"
@@ -2779,7 +2777,7 @@ components:
27792777
required:
27802778
- name
27812779
- petType
2782-
Cat: # "Cat" will be used as the discriminator value
2780+
Cat: # "Cat" will be used as the discriminating value
27832781
description: A representation of a cat
27842782
allOf:
27852783
- $ref: '#/components/schemas/Pet'
@@ -2795,7 +2793,7 @@ components:
27952793
- aggressive
27962794
required:
27972795
- huntingSkill
2798-
Dog: # "Dog" will be used as the discriminator value
2796+
Dog: # "Dog" will be used as the discriminating value
27992797
description: A representation of a dog
28002798
allOf:
28012799
- $ref: '#/components/schemas/Pet'
@@ -2933,7 +2931,7 @@ The Discriminator Object does this by implicitly or explicitly associating the p
29332931
##### Fixed Fields
29342932
Field Name | Type | Description
29352933
---|:---:|---
2936-
<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.
2934+
<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.
29372935
<a name="discriminatorMapping"></a> mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references.
29382936

29392937
This object MAY be extended with [Specification Extensions](#specificationExtensions).
@@ -3008,7 +3006,7 @@ MyResponseType:
30083006
monster: https://gigantic-server.com/schemas/Monster/schema.json
30093007
```
30103008

3011-
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.
3009+
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.
30123010

30133011
When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity for serializers/deserializers where multiple schemas may satisfy a single payload.
30143012

0 commit comments

Comments
 (0)