-
-
Notifications
You must be signed in to change notification settings - Fork 766
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
Take into account (x-)nullable when validating defaults #1463
Conversation
c3c8e8c
to
842bb4d
Compare
Pull Request Test Coverage Report for Build 1853825683
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, overlooked something!
'type': allow_nullable(Draft4Validator.VALIDATORS['type']), | ||
'enum': allow_nullable(Draft4Validator.VALIDATORS['enum']), | ||
'type': NullableTypeValidator, | ||
'enum': NullableTypeValidator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually be NullableEnumValidator
:
'enum': NullableTypeValidator, | |
'enum': NullableEnumValidator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
@@ -67,3 +67,16 @@ paths: | |||
description: User object | |||
schema: | |||
$ref: '#/definitions/User' | |||
|
|||
/nullable_default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this endpoint actually tested? The added test doesn't seem to call it? Or is it purely the loading of the spec itself that caused issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the loading of the spec, since the validation of the spec itself failed.
Fixes #1462.
CC: @nielsbox