-
Notifications
You must be signed in to change notification settings - Fork 890
Proposal to follow Google and Schema.org's JSON Style Guide: Use "camelCase" Naming Convention #1247
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
Conversation
I appreciate the effort that you put into documenting this issue. I've personally been leaning toward changing the default recommendation for JSON members for a while now. We may have placed too much emphasis on correlating case between URLs and JSON members in forming our current recommendations. However, we can't use language as strong as I'll discuss this with the other editors and of course the community should chime in. |
By the way, I'm strongly opposed to referencing the Google Style Guide in the spec. But I am open to discussing its recommendations as related to JSON:API. Would you mind reopening this as an issue instead of a PR, and focus the discussion purely on recommending camel-case for JSON members? After all, we already recommend kebab-case for URLs, so that's not even a change you're proposing. |
I would be 100% in favor of this as well. |
removed Google Style Guide from spec
I see what you're saying. I actually did reference the Google Style Guide in the JSON recommends. Good call. Removed it. |
Also moved into an issue #1255 |
@garrettmac because it's dependency. If Google will decide to change their naming convention, this will means that {json:api} require to follow it too. |
I think that this is an area where better delineation of spec vs recommendations and the community around it is essential. That said right now the documentation is a bit hazy at best that "members" names apply to attributes, relations, urls, and types. |
Updating Naming Rules.
MUSTSHOULD use camelCasewith a emphasize on the first
Here goes.
I think it should be changed or dropped.
I know this is a heavily opinionated topic, but here goes.
The JSON object property naming conventions seem to favor camelCase.
Styleguides that explicitly say to use
camelCase
.Google JSON Style Guide (they follow the JSON.org spec):
here are a few more:
W3resource(same thing) state:
Crockford state:
Schema.org
camelCase
in the wild:camelCase
for fields.Using
kebab-case
kebab-case
notation has collisions (or does not play nicely) with:person.first-name
)Conclusion
Issues as a result or related to the spec using saying to use
kebab-case
are as follows:#323
#571
#191
#127
#1242
#850
#525
#341
I'd expect they will continue until this issue is resolved, especially as GraphQL becomes more popular.
I think it's safe to assume
camelCase
won this battle, especially with JSON-LD, schema.org and as GraphQL continues to grow.I think this spec should it be changed or dropped, curious on your take @dgeb @ethanresnick @tkellen
More Resource and Discussion on web