-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fix schema for config.invalidValues
#3240
Conversation
"type": "string" | ||
"type": [ | ||
"string", | ||
"null" |
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.
@domoritz The schema generator actually still generate incorrect results here.
(The enum
property should include null
above -- otherwise, JSON schema validator would still throw warning.)
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.
Hmm, so you want it to be
enum: "filter", null
type: string
?
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.
I think it should be
enum: ["filter", null]
type: ["string", "null"]
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.
https://spacetelescope.github.io/understanding-json-schema/reference/null.html isn't clear about this but it seems that you are right: json-schema-org/json-schema-spec#258. We do need to add the type and also add null
to the enum.
Filed in vega/ts-json-schema-generator#22
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.
Fixed. I added a commit with the new schema.
… needed when we specify | null
Fix #3234