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

How to document the response body? #583

Open
wtfuii opened this issue Nov 11, 2016 · 4 comments
Open

How to document the response body? #583

wtfuii opened this issue Nov 11, 2016 · 4 comments

Comments

@wtfuii
Copy link

wtfuii commented Nov 11, 2016

Hello there,

did I miss anything or is there no way to document the response model for requests in django-rest-swagger?

For simple GET requests, the documentation only provides "HTTP Status Code" "200", with an empty Response Model, which should be wrong for most requests.

It seems that coreAPI does not support the documentation of responses, even though this feature is crucial especially for automatic client code generation out of the generated swagger file.

@wtfuii
Copy link
Author

wtfuii commented Nov 11, 2016

There is hope this will be accomplished trough core API: encode/django-rest-framework#4502

@hairui
Copy link

hairui commented Dec 1, 2016

I have the same question. It seems that the django-rest-swagger can catch only the success code ( for example 200,204...) from the view code.
And I have not seen any error code caught by djang-rest-swagger, even I write that in the views.py.

@tovmeod
Copy link

tovmeod commented Jun 22, 2017

Hi, I saw many people with the same issue or something similar, I pushed the missing features I wish existed between this project, coreapi, coreschema, openapi_codec, and DRF.

I just added the necessary to be able to generate the static swagger file I had. I pushed this so others may be able to use, comment and improve until the features are merged.

I hope others will contribute instead of each rolling his own solution
https://github.com/tovmeod/drf-swagger-missing

@sdrendall
Copy link

Ended up here and thought I should provide an update. There is real discussion of integrating this in DRF. At the moment however, this appears to be the best thing out there: https://github.com/axnsan12/drf-yasg

For more discussion: encode/django-rest-framework#4502

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

No branches or pull requests

4 participants