You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inflectKeys: camelize the field names per record. Default: true.
However, we've found that if the recordType attribute is already camelCase (e.g. phoneNumber ), it's transformed to phone-number via e.g. https://github.com/fortunejs/fortune-json-api/blob/2.1.2/lib/helpers.js#L213 ) so have set inflectKeys:false to preserve them , which makes the README seem misleading.
What's the intended behaviour for camelCase'd attributes?
The text was updated successfully, but these errors were encountered:
Oops, it seems the README is misleading, or at least only describes one direction. It is true that it camelizes field names from the request body when creating or updating records. But it also dasherizes field names on output. That's why it's called inflectKeys and not camelize/dasherize.
Fields on a record type should follow JS convention of camelCase in JS code, nothing unusual here.
Member names SHOULD contain only the characters “a-z” (U+0061 to U+007A), “0-9” (U+0030 to U+0039), and the hyphen minus (U+002D HYPHEN-MINUS, “-“) as separator between multiple words.
I don't make those recommendations, and would have liked it if they made it less confusing.
Hi, the README states
However, we've found that if the recordType attribute is already camelCase (e.g. phoneNumber ), it's transformed to phone-number via e.g. https://github.com/fortunejs/fortune-json-api/blob/2.1.2/lib/helpers.js#L213 ) so have set
inflectKeys:false
to preserve them , which makes the README seem misleading.What's the intended behaviour for camelCase'd attributes?
The text was updated successfully, but these errors were encountered: