From 8532ea60534e9e20ede41dcd9b025f180d7a9fe0 Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Sat, 20 Apr 2024 12:59:10 -0700 Subject: [PATCH 1/2] Non-string discriminator values have undefined behavior The "undefined" wording was chosen to allow implementations that make a good-faith effort to accommodate non-string values to remain compliant. However, new implementations are not expected to implement any sort of type coersion, and this guides API designers away from that expectation. --- versions/3.0.4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/3.0.4.md b/versions/3.0.4.md index 9bab2e150e..5d0e6b746f 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -2718,7 +2718,7 @@ Field Name | Type | Description propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value. mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references. -The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`. +The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`. Note that because the discrinating property's value is used as a component name and/or as the key in the `mapping` object, the behavior of any value that is not a string is undefined. In OAS 3.0, a response payload MAY be described to be exactly one of any number of types: From cb0e8c686f61b8d21c3793a64e405b0aa4adba4b Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Mon, 22 Apr 2024 08:16:11 -0700 Subject: [PATCH 2/2] Fix typo (review feedback) Co-authored-by: Ralf Handl --- versions/3.0.4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/3.0.4.md b/versions/3.0.4.md index 5d0e6b746f..1bb8d7edb8 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -2718,7 +2718,7 @@ Field Name | Type | Description propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value. mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references. -The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`. Note that because the discrinating property's value is used as a component name and/or as the key in the `mapping` object, the behavior of any value that is not a string is undefined. +The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`. Note that because the discriminating property's value is used as a component name and/or as the key in the `mapping` object, the behavior of any value that is not a string is undefined. In OAS 3.0, a response payload MAY be described to be exactly one of any number of types: