Skip to content

Commit 1308aa8

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 726929f commit 1308aa8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

versions/3.0.4.md

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

166166
#### <a name="resolvingImplicitConnections"></a>Resolving Implicit Connections
167167

168-
***TODO: In another PR***
169-
170168
### <a name="dataTypes"></a>Data Types
171169

172170
Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
@@ -2648,7 +2646,7 @@ components:
26482646
]
26492647
},
26502648
"Cat": {
2651-
"description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
2649+
"description": "A representation of a cat. Note that `Cat` will be used as the discriminating value.",
26522650
"allOf": [
26532651
{
26542652
"$ref": "#/components/schemas/Pet"
@@ -2675,7 +2673,7 @@ components:
26752673
]
26762674
},
26772675
"Dog": {
2678-
"description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
2676+
"description": "A representation of a dog. Note that `Dog` will be used as the discriminating value.",
26792677
"allOf": [
26802678
{
26812679
"$ref": "#/components/schemas/Pet"
@@ -2717,7 +2715,7 @@ components:
27172715
required:
27182716
- name
27192717
- petType
2720-
Cat: # "Cat" will be used as the discriminator value
2718+
Cat: # "Cat" will be used as the discriminating value
27212719
description: A representation of a cat
27222720
allOf:
27232721
- $ref: '#/components/schemas/Pet'
@@ -2733,7 +2731,7 @@ components:
27332731
- aggressive
27342732
required:
27352733
- huntingSkill
2736-
Dog: # "Dog" will be used as the discriminator value
2734+
Dog: # "Dog" will be used as the discriminating value
27372735
description: A representation of a dog
27382736
allOf:
27392737
- $ref: '#/components/schemas/Pet'
@@ -2758,7 +2756,7 @@ The Discriminator Object does this by implicitly or explicitly associating the p
27582756
##### Fixed Fields
27592757
Field Name | Type | Description
27602758
---|:---:|---
2761-
<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.
2759+
<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.
27622760
<a name="discriminatorMapping"></a> mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references.
27632761

27642762
##### Conditions for Using the Discriminator Object
@@ -2834,7 +2832,7 @@ MyResponseType:
28342832
monster: https://gigantic-server.com/schemas/Monster/schema.json
28352833
```
28362834

2837-
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.
2835+
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.
28382836

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

0 commit comments

Comments
 (0)