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

Don't treat not as an array (in contrast to allOf, anyOf, oneOf) #3941

Merged
merged 2 commits into from Nov 21, 2017

Conversation

shockey
Copy link
Contributor

@shockey shockey commented Nov 21, 2017

Description

This fixes Swagger-UI's incorrect parsing of Schema object not values. It looks like I introduced this problem - looking back at the RC1 definitions I wrote to implement against, the Schema Object definition had an invalid array under the not key (presumably a result of copy-pasting anyOf/oneOf). Mea culpa!

Per JSON Schema (emphasis mine):

allOf

The value of this keyword MUST be an array. This array MUST have at least one element.

Each element of this array MUST be an object, and each object MUST be a valid JSON Schema.

anyOf

The value of this keyword MUST be an array. This array MUST have at least one element.

Each element of this array MUST be an object, and each object MUST be a valid JSON Schema.

oneOf

The value of this keyword MUST be an array. This array MUST have at least one element.

Each element of this array MUST be an object, and each object MUST be a valid JSON Schema.

not

The value of this keyword MUST be an object. This object MUST be a valid JSON Schema.

Motivation and Context

Fixes #3932.

How Has This Been Tested?

  • Manually tested (screenshot below).

Screenshots (if appropriate):

messages image 3494563957

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shockey shockey merged commit 01d84cd into swagger-api:master Nov 21, 2017
@shockey shockey deleted the bug/3932-schema-not-values branch November 21, 2017 22:40
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.

"Could not render this component" error in "not" schemas
1 participant