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

Add "const" keyword for constant values. #139

Merged
merged 1 commit into from
Nov 19, 2016

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Nov 8, 2016

This addresses issue #58, which got quite a few upvotes and has
a "draft 6" milestone.

I used the shorter "const" that several people suggested rather
than "constant", but obviously that's easy to change if the longer
form is preferred.

The wording was pretty much directly lifted from "enum".

This addresses issue json-schema-org#58, which got quite a few upvotes and has
a "draft 6" milestone.

I used the shorter "const" that several people suggested rather
than "constant", but obviously that's easy to change if the longer
form is preferred.

The wording was pretty much directly lifted from "enum".
@awwright
Copy link
Member

I was going to merge this right now but I just wondered if there's any demand for the short form.

Most keywords seem to prefer the verbose language (suggesting we use "constant") and @epoberezkin already seems to use "constant" too.

@handrews
Copy link
Contributor Author

@awwright one objection had been that "constant": "foo" was actually more characters than "enum": ["foo"] and "contst" was suggested as a shorter alternative, to which no one seemed to object.

I'm perfectly happy either way. Let me know if you want me to change it, or feel free to change it yourself before accepting the merge (I think I flagged the thing that lets you do a further edit, and if all you do is change "const" to "constant" that doesn't really need input from me). Also happy to do the edit myself.

@awwright
Copy link
Member

I realized, I guess "enum" is short for "enumeration".

And yeah, it looks like "const" would be more popular. This looks good then.

@awwright awwright merged commit d7f98b5 into json-schema-org:master Nov 19, 2016
@handrews handrews deleted the const branch November 21, 2016 18:01
@epoberezkin
Copy link
Member

const is good :)

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.

4 participants