- Notifications
You must be signed in to change notification settings - Fork302
Preserve values from being formatted#420
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
6131764
to89d8445
Comparecodecov-io commentedApr 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #420 +/- ##==========================================+ Coverage 92.6% 92.68% +0.08%========================================== Files 54 54 Lines 2812 2858 +46 ==========================================+ Hits 2604 2649 +45- Misses 208 209 +1
Continue to review full report at Codecov.
|
Introduce `JSON_API_FORMAT_FIELD_NAMES` which preserves keys of values.`JSON_API_FORMAT_KEYS` still exists but is deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Did the existing format_keys() also format the values? I was not aware, but I see where it recurses down the tree.
Good that you've fixed it.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#313
Description of the Change
According toJson API Spec should only field names (hence the name
JSON_API_FORMAT_FIELD_NAMES
) be specifically named resp. formatted. The value itselfmay contain any json value though and we should keep it as is.With the option
JSON_API_FORMAT_KEYS
all keys (incl. value keys) are formatted though. This leads to underscored keys of a attribute value in Django code (or even on the database when usingJSONField)To fix this I have introduced
JSON_API_FIELD_NAMES
setting which preserves value from being formatted.JSON_API_FORMAT_KEYS
still works as before though for backwards compatibility but is marked deprecated.Checklist
CHANGELOG.md
AUTHORS