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

Make setting axis or legend = null as the default way to disable them. #1384

Merged
merged 11 commits into from
Oct 19, 2016

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented May 22, 2016

Remove the support for axis: false and just support axis: null and simplify the schema
as briefly discussed in #1377.

@kanitw kanitw added Blocked 🕐 For issues that are blocked by other issues and removed #-Ready for Review labels May 22, 2016
@kanitw
Copy link
Member Author

kanitw commented May 22, 2016

Looks like we're blocked because our JSON schema validator doesn't support null yet.

@domoritz
Copy link
Member

domoritz commented May 22, 2016

I read the error message differently. I think we just have to add null as an option (null seems to be a type like number or object).

@domoritz
Copy link
Member

domoritz commented May 22, 2016

@domoritz domoritz removed the Blocked 🕐 For issues that are blocked by other issues label May 22, 2016
@domoritz
Copy link
Member

domoritz commented May 22, 2016

Okay, issue is that there is no null type in typescript and we are blocked on YousefED/typescript-json-schema#36 but nullable types are coming to ts soon (already merged) microsoft/TypeScript#7140

@kanitw kanitw removed the Blocked 🕐 For issues that are blocked by other issues label Oct 3, 2016
Haven't tested since I don't have TS 2.0 locally yet!
@domoritz domoritz merged commit 0aeaa8e into master Oct 19, 2016
@domoritz domoritz deleted the kw/axis-legend-null branch October 19, 2016 23:36
@aishfenton
Copy link
Contributor

How will nullable be expressed in the scheme? In wrapper languages we'll need to handle this case explicitly (since not all types can be null, so will need to do something funky).

Json schema has "required" but that really means undefinable, and is already being used for that purpose.

And in general in JavaScript is it ok to have null != undefined? I don't know since I'm not a JS guy, but in typed languages there's really no equivalent to this, so having them mean something different will be tricky to support (for example in the Json parser I'm using it assume they're equivalent).

@domoritz
Copy link
Member

@aishfenton We explicitly mark properties that can be null. In typescript, they have a @nullable annotation and in the schema the properties are an enum with null as a possible value.

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.

3 participants