-
Notifications
You must be signed in to change notification settings - Fork 271
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
Documentation request: Improve migration guide / differences cheatsheet from drf-yasg #195
Comments
Hey @TauPan, thanks for your kind words. much obliged. so if you used
well even though the interface for regarding your points, i believe there have been quite a few improvements:
AcceptHeaderVersioning has been added by #144 and has since been improved a few times. path versioning should also work as expected.
at some point we only passed the request if the schema was served over the API, but CLI generation had no request. now we either provide the request or create a mock request, which has worked pretty well so far. (#145 and e3103ed)
we currently have a PR (#191 - issue #140) for that if you refer to the
so strictly speaking the concept of views does not exist in the schema, only endpoints. what we do is trying to get the most appropriate docstring if available. so either use string from the documentation did only change marginally, but the migration page is the same, that is true. it was meant as a starting point and not an exhaustive guide when i wrote it. if generally applicable, would be happy for any contributions there. imho, it also not that easy to cover everyones workflow there. with all that said, i'm happy to address issues that are still blocking you. furthermore i'm very interested in things that |
Ok looks like I need to re-try the migration later and take more specific notes and check if I still encounter problems. I can't promise to do that very soon, but it looks like drf-spectacular will remain in the list of candidates (at least I don't know of any alternatives). |
yeah sure. i'll close this issue for now. feel free to open new issues for any remaining problems you encounter. usually the required changes are minimal and quickly done. there aren't many fuzzy spots left. |
Hi!
First of all:
Thanks for your efforts. I appreciate somebody stepping in to support openapi 3 for autogenerated DRF-docs. I frequently have things I can't do with drf-yasg / swagger and I would really like to use openapi 3.
A couple of months ago (July 2020) I've experimented with porting our codebase from drf-yasg to drf-spectacular but gave up after half a day or so. At that time it wasn't clear to me:
I think https://github.com/tfranzel/drf-spectacular/blob/master/docs/drf_yasg.rst was identical to the current version back then.
Now I'm thinking to try again, but feel somewhat reluctant, because the documentation hasn't changed and I don't know if I will hit another stumbling block.
These are my notes from back then. Possibly some of those would be appropriate as separate issues, but I want to focus on my stumbling blocks here:
We use a mixin of AcceptHeaderVersioning and QueryParameterVersioning. The former is encouraged for production code, the latter can be used for convenience in the browsable api, and is still not supported. drf-yasg parses the version header from the query and allows us to display links in the documentation for switching between versions. (Migrating to UrlPathVersioning or NamespaceVersioning would not be feasible.)
It seems that drf-spectacular did not pass the request at all. This looks like it's fixed by now django-filters emits warnings during schema generation #81
Resources and Actions didn't have titles and it wasn't clear how to display them.
Similarly, mapping docstrings to views/actions didn't happen the way it did in drf-yasg and it wasn't clear to me how. More docstrings #107 (comment) seemed related (also closed by now).
So insofar as there are fixed bugs or new implemented features it might be helpful for new users like me to upgrade
drf_yasg.rst
accordingly and/or clarify what is not supported by drf-spectacular yet.If I should file a separate issue for some of these items, please tell me so.
The text was updated successfully, but these errors were encountered: