Skip to content

Avoided that an empty attributes dict is rendered #1196

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 1 commit into from
Dec 28, 2023

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Dec 28, 2023

Description of the Change

Attributes member is actually optional and may not be rendered if there are no serializer attribute fields. But currently it does. The renderer though already made sure, that relationships are not rendered if there are not any, so this change makes it 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

Attributes is actually optional and may not be rendered if there
are no serializer attribute fields.
@sliverc sliverc requested a review from n2ygk December 28, 2023 16:51
@n2ygk n2ygk merged commit 36c92a3 into django-json-api:main Dec 28, 2023
@sliverc sliverc deleted the optional_attributes branch December 28, 2023 17:12
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.

2 participants