-
Notifications
You must be signed in to change notification settings - Fork 27
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
Library converts underscores to hyphens against spec #24
Comments
I personally prefer underscores over dasherized. However, some of the community around JSON API (especially Ember Data) has taken to using hyphens instead of underscores. As the majority of the users of this project use Ember Data, I went with hyphens just to ease setup. Since 5.0.0 is the next major release and as it is a breaking release, I'll let it be more freeform on attribute names and such. |
Actually, looking into it further, the use of hyphens is actually recommended. http://jsonapi.org/recommendations/#naming I'll make it overridable in the next version with default being hyphens. |
Ah, I didn't see that. I can put up a PR to let you override the default behavior if that's cool with you. I have a fork where I just took out dasherize entirely because it was causing me a lot of pain (I'm not using Ember). I can fix it to make it configurable. |
The spec doesn't require it, although it is recommended. I personally don't want the behavior because I want my client attributes to match those in the database. Fixes ColtonProvias#24
The spec doesn't require it, although it is recommended. I personally don't want the behavior because I want my client attributes to match those in the database. Fixes ColtonProvias#24
The spec doesn't require it, although it is recommended. I personally don't want the behavior because I want my client attributes to match those in the database. Fixes ColtonProvias#24
The spec doesn't require it, although it is recommended. I personally don't want the behavior because I want my client attributes to match those in the database. Fixes ColtonProvias#24
The spec doesn't require it, although it is recommended. I personally don't want the behavior because I want my client attributes to match those in the database. Fixes ColtonProvias#24
The spec allows for member names with underscores, but this library converts them to hyphens. I'd prefer that it at least be configurable to not do that, since it makes it annoying to pull the data out in Javascript:
data.attributes.some_field
vsdata.attributes['some-field']
http://jsonapi.org/format/#document-member-names-allowed-characters
The text was updated successfully, but these errors were encountered: