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

Fix schema for config.invalidValues #3240

Merged
merged 2 commits into from
Dec 31, 2017
Merged

Fix schema for config.invalidValues #3240

merged 2 commits into from
Dec 31, 2017

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Dec 19, 2017

Fix #3234

"type": "string"
"type": [
"string",
"null"
Copy link
Member Author

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.)

Copy link
Member

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

?

Copy link
Member Author

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"]

Copy link
Member

@domoritz domoritz Dec 30, 2017

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

Copy link
Member

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.

@kanitw kanitw merged commit e9d6a46 into master Dec 31, 2017
@kanitw kanitw deleted the kw/filter-invalid branch December 31, 2017 15:05
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.

2 participants