devour-client icon indicating copy to clipboard operation
devour-client copied to clipboard

Devour should have a mechanism for attribute name serialization control

Open k8n opened this issue 8 years ago • 0 comments

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

k8n avatar Oct 18 '17 19:10 k8n