Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Added support for array type responses #438

Merged
merged 1 commit into from
May 3, 2016
Merged

Added support for array type responses #438

merged 1 commit into from
May 3, 2016

Conversation

MrTam
Copy link

@MrTam MrTam commented Apr 27, 2016

Another one I needed - support for Arrays.

DRS doesn't make any attempt at the moment to discern if a view returns an array of Serializer objects. This is problematic when used with swagger-codegen, as APIs which are supposed to return lists of objects don't say that they do, and codegen expects a single object response.

I did see a similar PR #404, but this has been open for several months with no activity and I needed this for my own purposes now.

What this PR does that the other does not, is push inspection into the introspection layer. In addition, viewset methods named list are automatically made into array responses (as they always are with DRF). I've taken the concept of applying 'many' to the YAML docstring stanza as well, to allow FBVs and other detail / list routes in viewsets to work.

I've also added an expanded information section in misc.rst, with cross-referenced expansion on the many yaml attribute in yaml.rst.

Any questions, give me a shout.

@marcgibbons
Copy link
Owner

Great - thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants