Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Function views are not included in the auto documentation #5343
Steps to reproduce
Write function view, open docs.
Function views should be present in the generated documentation. DRF docs or Swagger for DRF can pick them as as expected.
Views are not present.
Or am I missing something? Thanks
Sorry. Should have be more specific.
and the function view itself is not nested:
But what's the relevant part of the schema? You said
If it's nested under
Well, it's good it shows.
OK. Can you help diagnose that? Is there an error in the JS console for instance? (@Woile: could there be a lingering issue in the JS
This is just to do with how the
Well, you can subclass
OK. I cannot reproduce an issue here.
With a class-based view, nested and displayed using
@hnykda — you're dealing with function-based views right. I'm guessing that the introspection doesn't give enough to build the request. i.e. Without a
@carltongibson I tried reproducing with
He is right in the naming convention though, I don't know if
@Woile: Thanks for the follow-up! (It really helps.)
The rigidity of the naming is known. (e.g. #5165 and others). #5337 should allow flexibility, without settings (shudder
@hnykda: Thanks for the report and your follow-up!
I'm going to close this as ultimately I think it's a usage issue rather than anything particular. Yes, there are still teething issues with the schema generation but I think we need to review after the next phase.
Please stay involved: feedback and input is really important. (If it's a usage question the Mailing List is the best place; if it's a bug then here.)
Hey! Thank you for such a quick response! Sorry for a delay from my side.
Yes, I am using function views. And yes - after trying in an Chrome anonymous window or Firefox, it works as expected - so it was probably cached somehow. Again, sorry.
I really like @Woile idea about settings, where we could just have a METHOD + URL definition instead REST. You mentioned that there are edge cases. I am curious - how else do you do a non-model related API endpoints, e.g. "run a service job which updates some assets somewhere" and so on? AFAIK, class based API views are to rigid for that, hence the function views.
@hnykda Thanks for the follow-up.
In this case you extend