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 Serializer schema generation when used as a ListField child #1175

Closed
wants to merge 1 commit into from
Closed

Fix Serializer schema generation when used as a ListField child #1175

wants to merge 1 commit into from

Conversation

arttuperala
Copy link
Contributor

Description of the Change

Fixes schema generation for Serializer when it's used as a child of a ListField. Previously it'd use the full JSON:API serializer schema even though it doesn't render the "type", "id", "attributes", etc. fields in the response.

Also added a unit test for API response when using the ListField with a Serializer child while I was at it since there didn't seem to be one. This way it'll be a bit better defined how these work in DJA.

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
Copy link
Member

sliverc commented Sep 18, 2023

Thanks for the contribution. At a look of it, this exact problem also occurs with nested serializers right? If yes, could you adjust the PR, so that is covered as well?

@arttuperala
Copy link
Contributor Author

Yeah, we ran across the nested serializer issue right aftewards. I had actually fixed it on another branch, but since I wasn't sure if it met the "PR only contains one change" criteria and since it was based off of this branch, I didn't have a PR open for it. Submitted that branch separately as #1177.

@arttuperala arttuperala deleted the listfield-serializer-schema branch September 19, 2023 06:59
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