django-rest-framework-docs icon indicating copy to clipboard operation
django-rest-framework-docs copied to clipboard

ModelViewSet doesn't show request methods, instead it only show option button

Open gauravsoni119 opened this issue 8 years ago • 27 comments

I am using model view set and register it with router. On /docs url, it shows only option button. It doesn't show request methods(eg. GET, POST etc). Similarly on clicking plugin button, it only shows option button, not request methods. I am not able to send get request. Since it shows field required error messages.

gauravsoni119 avatar Feb 13 '16 08:02 gauravsoni119

Hello @gauravsoni119! Unfortunately DRFdocs currently doesn't support ModelViewSet but it it is the first thing on my list and hope to solve it soon!

manosim avatar Feb 19 '16 15:02 manosim

For information, this issue is solved in https://github.com/debnet/django-rest-framework-docs

A second pull request will follow as soon as we merged upstream/master.

debnet avatar Feb 19 '16 15:02 debnet

@debnet That looks really nice! https://github.com/debnet/django-rest-framework-docs/commit/85ba4d2623a45a336623c6862bbaa1937704d923

Looking forward to a PR with ModelViewSet support!

manosim avatar Feb 19 '16 23:02 manosim

@debnet If you need any help or want to discuss about implementing ModelViewSet, there is now a slack channel in the pythondev.slack.com team - channel #drfdocs. Feel free to ping me there!

manosim avatar Feb 22 '16 22:02 manosim

Fixed in #70.

debnet avatar Feb 29 '16 10:02 debnet

@debnet I am really looking forward to a pypi release. This would make me move my project to drfdocs. :-)

soerenbe avatar Mar 14 '16 22:03 soerenbe

22 days from fix, still not on pypi. Why?

ambivalentno avatar Mar 22 '16 13:03 ambivalentno

+1

BrunoLN avatar Mar 22 '16 14:03 BrunoLN

Hello! There is only problem with that PR it adds more functionality than just support for ModelViewSets so I would prefer to split it up. @debnet Can you make a pull request only with support for ModelViewSets?

Ps. Maybe use cherry-pick from the existing PR?

manosim avatar Mar 22 '16 14:03 manosim

yes, unfortunately, current pull request makes code much more complicated. @debnet will you update pullrequest, or I should do that (hope, this weekend)?

ambivalentno avatar Mar 25 '16 12:03 ambivalentno

In my opinion, the code is much clearer that way and it provides some new appreciable features. We use it everyday in production environment, but if you would to slice it into multiple PR, free to you to do so, I don't even know how to do this on my fork. ^^

debnet avatar Mar 25 '16 13:03 debnet

hi, is there any update here? ModelViewSet is something widely used

egamonal avatar Apr 12 '16 09:04 egamonal

Hi @egamonal! This one appears to be more complicated than it looks. There is some work in progress in #74. Hope to have some news and a PyPI release soon!

Ps. I know many people(including myself) are waiting for this one!

manosim avatar Apr 12 '16 18:04 manosim

:+1:

Ivaylo-Bachvarov avatar May 05 '16 14:05 Ivaylo-Bachvarov

Hi! @ekonstantinidis I really like your project. I would really like to contribute but am not sure how. I think that this is the most important issues because it makes the project unusable. I see that this issue is marked as "work in progress" but the last commit was 2 months ago.

Do you want some help for that issue? Do you still maintain this project?

I plan to look at the source this days and send some PRs.

Ivaylo-Bachvarov avatar May 17 '16 21:05 Ivaylo-Bachvarov

Hello @Ivaylo-Bachvarov ! Thank you for your kind words! I've been really busy with work and another project and supporting ModelViewSet appears to be more complicated than it looked in the beginning. I've started a PR ( #74 ) but didn't have the time to finish it. So yes - it would be great if you can help with this issue and I'll be more than happy for any PRs.

The project is still maintained and my plan is to work on it in the next couple of months. There is a Slack room under the pythondev team(http://pythondev.slack.com) so if I can help you with anything ping me there! Thanks!

manosim avatar May 17 '16 21:05 manosim

Any update about this?

dekoza avatar Jun 07 '16 22:06 dekoza

@dekoza I didn't have time to tackle this one yet. Any help is much appreciated!

manosim avatar Jun 07 '16 23:06 manosim

Hello, is there any update about this issue? We would like to use drfdocs but only if this feature is available. Thanks for any news on this.

filias avatar Oct 21 '16 09:10 filias

Does it have to be for ModelViewSets? I'm developing ViewSets and I think this work could apply to those too.

StyXman avatar Nov 04 '16 09:11 StyXman

I've been playing with drfdocs and drf-swagger. I think I really like drfdocs for its cleanness and tidiness. Is there any work on this issue that is promising? I can give a hand to make it better.

xgenvn avatar Nov 24 '16 16:11 xgenvn

@debnet just installed your fork, is there anything that should be added to the code for this to work? I´m still only seeing the options method.

busla avatar Dec 14 '16 08:12 busla

Any further news on this, as it's holding me back from utilizing this wonderful app :)

BuckinghamIO avatar Mar 01 '17 15:03 BuckinghamIO

+1 on that. Any word on whether this is still in progress?

henryJack avatar Mar 02 '17 16:03 henryJack

Seems to work for me. Could you provide more details @busla?

image

debnet avatar Mar 03 '17 14:03 debnet

@debnet, Yes, a limited number of POST requests will show up in DRF docs. For example, this URL allows GET and POST... xml_upload

and both of them show up in drf docs as expected... xml_upload_drf

For normal viewsets this works brilliantly. The issue described is specifically for ModelViewSets.

henryJack avatar Mar 07 '17 09:03 henryJack

For ModelViewSets the DRF docs does not display the "POST" option... The top two images show a valid POST, GET and OPTIONS request for a given URL. But the bottom image of the DRF docs shows only GET and OPTIONS. The POST option seems to be missing which currently makes DRF docs unusable for me. This is a shame it mainly looks incredibly promising

django_top django_bottom use_this

henryJack avatar Mar 07 '17 09:03 henryJack