-
Notifications
You must be signed in to change notification settings - Fork 23
Use dasherized resource type naming #56
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
Okay, I merged #51 to master, but that means I need to merge it also with the 0-4-0 branch...which I can't do from my phone, so tomorrow. With the dasherized top level keys (really with the dasherized URLs too) we should probably be providing a subclass of kurko's JsonApiAdapter that works with our spec implementation. Even if it's just in a wiki page. Do you already have one? Or am I crazy and this won't break the off-the-shelf adapter? |
By default
I don't need anything special to make the serializer use dasherized resource type names in my project because I dasherize all my model names at the source. But I guess there really ought to be an optional automatic conversion for people who haven't set up their models that way. |
Confused, you can't mean |
Use dasherized resource type naming
I use Ember CLI, which doesn't use the globals resolver. It resolves items as ES6 modules based on the filename they are in - I don't have
|
Huh... So if you have a module named |
Yes, We started our Ember app around May 2014, when Ember CLI was still rough around the edges. I'm glad we made that decision, since Ember CLI is going to be the recommended and documented way to build Ember apps in 2.0. |
This PR depends on #51, because I needed acceptance tests.
This implements the RC2 recommendation of using dasherized type names. It consists of two broad changes:
First, I added an IHttpControllerSelector that resolves the pascal-cased version of the request. The following requests will all create a
UserGroupsController
:Second, I've changed the model manager's
GetJsonKeyForType
method to return the dasherized form of the type name. So a classUserGroup
that gets pluralized toUserGroups
will then get serialized with the type nameuser-groups
.Closes #55