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

Use an array type for list view response schemas #6849

Merged

Conversation

reupen
Copy link
Contributor

@reupen reupen commented Jul 30, 2019

Refs #6846

Description

This is the first part of #6846.

Previously, the response schema for list views was an object representing a single item. However, list views return a list of items, and hence it should be an array.

Further work will need to be done to support how pagination classes modify list responses.

There should be no change for views not determined to be list views.

I also slightly refactored the logic to get a serialiser instance in AutoSchema so that it's shared between _get_request_body() and _get_responses().

I'd recommend looking at the two commits separately.

This is the first part of encode#6846.

Previously, the response schema for list views was an object representing a single item. However, list views return a list of items, and hence it should be an array.

Further work will need to be done to support how pagination classes modify list responses.

There should be no change for views not determined to be list views.
@reupen reupen marked this pull request as ready for review July 31, 2019 06:17
Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @reupen. Super.

@carltongibson carltongibson merged commit b45ff07 into encode:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants