Skip to content

Check for reserved field names in serializer meta class #987

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 2 commits into from
Oct 6, 2021

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Oct 3, 2021

Fixes #518
Fixes #710

Description of the Change

This is to avoid an incomprehensible exception during runtime when either meta or results is used as a field name.

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

Fixes django-json-api#518
Fixes django-json-api#710

This is to avoid an incomprehensible exception during runtime
when either meta or results is used as a field name.
@sliverc sliverc requested a review from n2ygk October 3, 2021 18:59
@codecov
Copy link

codecov bot commented Oct 3, 2021

Codecov Report

Merging #987 (1edef9f) into master (414547a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #987   +/-   ##
=======================================
  Coverage   96.82%   96.83%           
=======================================
  Files          65       65           
  Lines        3906     3914    +8     
=======================================
+ Hits         3782     3790    +8     
  Misses        124      124           
Impacted Files Coverage Δ
tests/test_serializers.py 100.00% <100.00%> (ø)
example/serializers.py 89.61% <0.00%> (+0.47%) ⬆️

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 414547a...1edef9f. Read the comment docs.

@n2ygk n2ygk merged commit e68a0f2 into django-json-api:master Oct 6, 2021
@sliverc sliverc deleted the reserved_field_names branch October 6, 2021 12:45
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.

Allow meta as attribute name Invalid detail route rendering when using results as field name
2 participants