-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Requirement of schema or content in parameter object is difficult to notice #1542
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
Comments
We are open to adding some clarification if someone can suggest a clean annotation markup to the spec. Should we duplicate the constraint in the each of the property descriptions? Suggestions are encouraged. |
I can see at least these two options:
Edit: commas |
To me this needs only says there's a XOR constraint on setting these two fields. This phrasing should be clearer:
This emphasizes that at least one is required, which I'm still not sure is correct? |
Hmm... this one is complicated because it's three separate tables of fixed fields: the general fields, and the each of the two mutually exclusive options. It's not just that exactly one of I think maybe a standard section after "Fixed Fields" listing relational constraints would be the best approach. Or maybe a "Field Combination Rules" table just before or after the Fixed Fields table without a section. But those Parameter Object tables need cleaning up anyway to make it clear that some keywords can be used with |
Ah, I was actually wrong about part of it, |
PRs for all active lines merged! Closing. |
One of the paragraphs within the "Parameter Object" section of the current OpenAPI v3 specification contains this statement:
The
schema
orcontent
fields in the tables of fields in the "Parameter Object" section do not contain the REQUIRED keyword. That is okay, because these fields are not strictly required. But at the same time, the entries in these tables do not mention a combined requirement of one of those fields.The statement mentioned at the beginning is easy to overlook. I think that the conditional requirement of any fields should also be mentioned in the table, because it is the first and often the only place where a person would normally look for the field's definition.
The text was updated successfully, but these errors were encountered: