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

minor simplification of v3.1 schema #2671

Merged
merged 4 commits into from
Sep 23, 2021

Conversation

karenetheridge
Copy link
Member

"if the X property is present, then apply this constraint to property X" can
be simplified by simply stating the constraint for property X.

Copy link
Contributor

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

You're right, this doesn't work like I intended.

Would you mind also making a couple other corrections I noticed when reviewing?

  1. The "allowEmptyValue" property doesn't apply to headers. That can be removed.
  2. The schema doesn't include the constraint that one and only of "schema" or "content" is required.

@karenetheridge
Copy link
Member Author

yes, give me a day or two

@karenetheridge
Copy link
Member Author

karenetheridge commented Aug 10, 2021

The "allowEmptyValue" property doesn't apply to headers. That can be removed.

Are you sure? https://spec.openapis.org/oas/v3.1.0#headerObject specifies that it's the same as parameter, except no 'name' or 'in' -- and 'parameter' has 'allowEmptyValue'.

edit: ok, on reading the spec more closely, it doesn't really make sense how this would be applied to headers. removing.

The schema doesn't include the constraint that one and only of "schema" or "content" is required.

done.

@jdesrosiers
Copy link
Contributor

jdesrosiers commented Aug 11, 2021

The "allowEmptyValue" property doesn't apply to headers. That can be removed.

Are you sure?

Sorry, I meant the "allowReserved" property doesn't apply to headers. 🤦

I came to this conclusion because the in value is implicitly header and the allowReserved description says, "This property only applies to parameters with an in value of query." Therefore, I concluded that allowReserved doesn't apply to the Header Object.

Actually, now that I look at it again, it looks like the same is true of allowEmptyValue. Its description says, "This is valid only for query parameters". This is for a header parameter, so it doesn't apply either.

schemas/v3.1/schema.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

Thanks!

"if the X property is present, then apply this constraint to property X" can
be simplified by simply stating the constraint for property X.
@webron webron merged commit 9acd3db into OAI:main Sep 23, 2021
@karenetheridge karenetheridge deleted the ether/schema-dependentSchemas branch September 26, 2021 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants