Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport (3.0.4) of merge resolution from #3846 #3880

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

@handrews handrews added discriminator clarification requests to clarify, but not change, part of the spec labels Jun 4, 2024
@handrews handrews added this to the v3.0.4 milestone Jun 4, 2024
@handrews handrews requested a review from a team June 4, 2024 19:07
handrews and others added 2 commits June 4, 2024 12:23
This backports changes made to the Discriminator Object
in 3.1.1 and merges them with the changes  made on this branch.

Note that the previouc changes incorporated reworked ideas from
@jdesrosiers regarding the ambiguous `mapping` syntax submitted
in the 3.1.1 changes but not accepted at that time due to
compatibility concerns.  This commit merges in the parts of
that 3.1.1 change that were accepted.

For the same compatibility reasons, the MUST wording for
requiring the named discriminator property in the schema
was (regrettably) weakened to a "SHOULD but otherwise undefined",
as we have done for other problematic ambiguities.

Co-authored-by: Jason Desrosiers <[email protected]>
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.

##### Fixed Fields
Field Name | Type | Description
---|:---:|---
<a name="propertyName"></a>propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value.
<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.
<a name="discriminatorMapping"></a> mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprising: we don't explicitly allow specification extensions here in 3.0.x?

Copy link
Member Author

@handrews handrews Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was surprised enough to check 3.0.3 and 3.0.0 to be sure, and we do not allow them.

@handrews handrews added the approved pr port PRs that just port an approved PR to another version label Jun 5, 2024
@miqui miqui merged commit 52c9d88 into OAI:v3.0.4-dev Jun 6, 2024
1 check passed
@handrews handrews deleted the disc-backport-304 branch June 6, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved pr port PRs that just port an approved PR to another version clarification requests to clarify, but not change, part of the spec discriminator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants