Skip to content

Preserve field names when no formatting is configured #909

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Apr 8, 2021

Fixes #899

Description of the Change

This way it is possible to have field names which do not follow the python underscore convention. As this introduces new utilities took the opportunity to make format methods more consistent.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

This way it is possible to have field names which do not follow the python
underscore convention.
@sliverc sliverc requested a review from n2ygk April 8, 2021 18:23
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #909 (c6931ef) into master (a25e387) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #909      +/-   ##
==========================================
- Coverage   97.67%   97.67%   -0.01%     
==========================================
  Files          58       58              
  Lines        3102     3093       -9     
==========================================
- Hits         3030     3021       -9     
  Misses         72       72              
Impacted Files Coverage Δ
rest_framework_json_api/django_filters/backends.py 100.00% <100.00%> (ø)
rest_framework_json_api/filters.py 100.00% <100.00%> (ø)
rest_framework_json_api/metadata.py 91.66% <100.00%> (ø)
rest_framework_json_api/parsers.py 98.55% <100.00%> (-0.17%) ⬇️
tests/test_views.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a25e387...c6931ef. Read the comment docs.

@sliverc
Copy link
Member Author

sliverc commented Apr 19, 2021

@n2ygk Do you think you will find time to have a look at this? Thanks.

@n2ygk
Copy link
Contributor

n2ygk commented Apr 23, 2021

@n2ygk Do you think you will find time to have a look at this? Thanks.

Sorry - I am so oversubscribed to github notifications that I miss the actionable ones like this. Looking at it now.

Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@n2ygk n2ygk merged commit 36a60a3 into django-json-api:master Apr 23, 2021
@sliverc sliverc deleted the reverse_formatting branch April 26, 2021 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure field names are only reversed when formatting is configured
2 participants