devour-client
devour-client copied to clipboard
Devour should have a mechanism for attribute name serialization control
Deserializer converts attribute names from "kebab-case" to camel case when fetching data; on the way back, the serializer does nothing. JSONAPI spec recommends kebab-case, I believe.
So, for example, my API returns { client_id: "1" }, but when asked, devour updates the API with { clientId: "1" }.
Further, there is no way to force devour to send attributes dasherized. E.g. $jsapi.update('matter', { id: "2864", 'client_id': '1'}) will not work.
Deserialize: https://github.com/twg/devour/blob/master/src/middleware/json-api/_deserialize.js#L46 Serialize: https://github.com/twg/devour/blob/master/src/middleware/json-api/_serialize.js#L27