You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
2648
2646
]
2649
2647
},
2650
2648
"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.",
2652
2650
"allOf": [
2653
2651
{
2654
2652
"$ref": "#/components/schemas/Pet"
@@ -2675,7 +2673,7 @@ components:
2675
2673
]
2676
2674
},
2677
2675
"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.",
2679
2677
"allOf": [
2680
2678
{
2681
2679
"$ref": "#/components/schemas/Pet"
@@ -2717,7 +2715,7 @@ components:
2717
2715
required:
2718
2716
- name
2719
2717
- petType
2720
-
Cat: # "Cat" will be used as the discriminator value
2718
+
Cat: # "Cat" will be used as the discriminating value
2721
2719
description: A representation of a cat
2722
2720
allOf:
2723
2721
- $ref: '#/components/schemas/Pet'
@@ -2733,7 +2731,7 @@ components:
2733
2731
- aggressive
2734
2732
required:
2735
2733
- huntingSkill
2736
-
Dog: # "Dog" will be used as the discriminator value
2734
+
Dog: # "Dog" will be used as the discriminating value
2737
2735
description: A representation of a dog
2738
2736
allOf:
2739
2737
- $ref: '#/components/schemas/Pet'
@@ -2758,7 +2756,7 @@ The Discriminator Object does this by implicitly or explicitly associating the p
2758
2756
##### Fixed Fields
2759
2757
Field Name | Type | Description
2760
2758
---|:---:|---
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.
2762
2760
<a name="discriminatorMapping"></a> mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references.
2763
2761
2764
2762
##### Conditions for Using the Discriminator Object
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.
2838
2836
2839
2837
When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
0 commit comments