-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hello,
I am using your blueprint system on an app with Ember.js as a front end, which is of course the ideal platform for JSON API 😊
I am running on Sails 1.0.0-36.
I am calling the JsonApiService inside of a controller to handle user signup.
This is a stub of the code I have made to check if the JSON API integration works:
signup: function (req, res) {
req.options.controller = 'user';
JsonApiService.createRecord(req, res);
}I would like to point out two bugs:
- I need to manually set req.options.controller since this is used by your parseModel to retrieve the actual model of the resource, but Sails does not set this value automatically.
- I am receiving the parameters as 'kebab-case' from my front end, therefore your service should serialize them correctly when injected in the Sails model, to camelCase (I have set
attributesDeserializedCase: 'camelCase'in the config/jsonapi.js), but Waterline triggers the following error:
UsageError: Invalid new record(s).
Details:
Could not use specified `first-name`. This is not a valid name for an attribute.
Where does your code do the serializing/deserializing? What is happening here?
Thank you in advance.
Metadata
Metadata
Assignees
Labels
No labels