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

improvement: adopt @webron's OpenAPI 3.0 schema #1984

Merged
merged 3 commits into from
Apr 12, 2019

Conversation

shockey
Copy link
Contributor

@shockey shockey commented Apr 12, 2019

this completes phase 1 of the Schema Validation Improvement Plan (the first half happened in #1982)

Verified

This commit was signed with the committer’s verified signature.
shockey kyle shockey
@shockey shockey changed the title adopt @webron's OpenAPI 3.0 schema improvement: adopt @webron's OpenAPI 3.0 schema Apr 12, 2019
$ref:
- "$ref"
patternProperties:
"^\\$ref$":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should this be Reference.properties.$ref instead of Reference.patternProperties.^\\$ref$?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Some JSON Schema draft-04 engines get tripped up on $ref as a property name, because draft-04 incorporated JSON Reference without adding any guards as to where $ref is semantically valid as a Reference vs it's a property name for an object.

AJV appears to handle this without any issues (while it did have issues with the regex workaround), so we're going to use Reference.properties.$ref here.

CC @webron!

shockey added 2 commits April 12, 2019 16:03

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@shockey shockey merged commit 87ba243 into swagger-api:master Apr 12, 2019
shockey added a commit to shockey/swagger-editor that referenced this pull request May 23, 2019

Verified

This commit was signed with the committer’s verified signature.
shockey kyle shockey
…ger-api#1984)

* adopt @webron's OpenAPI 3.0 schema from OAI/OpenAPI-Specification#1270

permalink: https://github.com/OAI/OpenAPI-Specification/blob/92e15eba1d4591ebfe8c11898c48241e72854381/schemas/v3.0/schema.yaml

* use literal `$ref` key in Reference Object schema

* `"$ref"` -> `$ref`
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.

None yet

1 participant