Skip to content
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

fix django-polymorphic empty serializer case #1029 #542 #1033

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

tfranzel
Copy link
Owner

@tfranzel tfranzel commented Jul 21, 2023

#542 fixed an assertion error when a sub-serializer had no fields (or only had RO/WO fields).

However, it is a valid case that a sub-serializer may be empty (except for the resource_type_field). Usually we would just have an empty body, but here it is a bit more involved. This fix includes that case without building an empty component.

@ngnpope fyi since you authored #542, this likely also affects you.

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b7f79b7) 98.55% compared to head (1481111) 98.55%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1033   +/-   ##
=======================================
  Coverage   98.55%   98.55%           
=======================================
  Files          68       68           
  Lines        8367     8372    +5     
=======================================
+ Hits         8246     8251    +5     
  Misses        121      121           
Impacted Files Coverage Δ
drf_spectacular/contrib/rest_polymorphic.py 96.96% <100.00%> (+0.41%) ⬆️
tests/contrib/test_rest_polymorphic.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tfranzel tfranzel merged commit bc9910c into master Jul 22, 2023
@tfranzel tfranzel deleted the fix_poly_ro_serializer branch July 22, 2023 06: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.

1 participant