Skip to content

Remove invalid validation of default included_resources #956

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

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Jul 6, 2021

Fixes #949

Description of the Change

#900 inadvertently introduced validation of default included_resources which does not work properly with nested included resources (such as when a default included resources also defines its own included resources).

This PR reverts this validation but leaving the default prefetching of default included resources as intended in PR #900.

This is a quick fix to get this regression solved. In the long run we need to think whether it makes sense at all to do validation of include in init of the serializer anyway. But can be discussed later.

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

@sliverc sliverc requested a review from n2ygk July 6, 2021 18:45
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #956 (49be826) into master (74d2ff8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #956   +/-   ##
=======================================
  Coverage   96.81%   96.81%           
=======================================
  Files          64       64           
  Lines        3888     3888           
=======================================
  Hits         3764     3764           
  Misses        124      124           
Impacted Files Coverage Δ
example/serializers.py 88.07% <ø> (ø)
example/tests/test_serializers.py 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 74d2ff8...49be826. Read the comment docs.

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.

👍

@sliverc sliverc merged commit b49aa6e into django-json-api:master Jul 6, 2021
@sliverc sliverc deleted the validation_included_resources branch July 6, 2021 18:57
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.

Validation of included_resources fails when nested
2 participants