master branch of Django REST framework.We tried using DRF OpenAPI3 for our production API, but soon found that the capabilites are severely limited and it does not cover a lot of things that more complicated APIs (heavily customized views and serializers) require:
Furthermore, some of the previously raised issues are covered in the PR for this issue, some of which are #6984 #7069 #6882 #6858 #6844 .
The existing code was a great starting point. thanks for all the hard work. We also took inspiration from the awesome OpenAPI2 library https://github.com/axnsan12/drf-yasg
A list of implemented features can be found in the PR.
To @fyhertz @Reshurum @glebovmaksim @stefanitsky @Behoston @dhaval-mehta @lucidiot @fangaofeng @auvipy @jgadelange @carltongibson and other who might have been interested in this.
We proposed massive changes to the schema generation, but only some parts got accepted. Indeed our PR #7089 was way to big and decomposing it (while retaining the functionality) was quite challenging.
In the end one of our core mechanics (#7096) got rejected in favor of #7124. Since this did not allow for the flexibility we required, we had to go another route.
For that reason we released our approach to schema generation as standalone package drf-spectacular https://github.com/tfranzel/drf-spectacular. Since the PR we did a lot more improvements so check it if you like. Happy for any PRs, suggestions & comments.
@tfranzel hi! Thanks, very interesting!
@tfranzel, very interesting!
I have 2 concerns.
@dhaval-mehta I absolutely get your concern. That is why I created the PR in the first place. Let me comment on your concerns.
AutoSchema concept, which will most likely not go away in the near future.drf-yasg was never shipped with DRF (which we used before).Apart from that I believe it also has benefits shipping as a separate tool. We can iterate faster and provide support for popular 3rd party apps. Pretty sure those pieces would have a very low chance of ever getting merged (and rightfully so).
Honestly we really needed a "usable" OpenAPI3 schema rather sooner than later. The DRF code was far away from being useful to us and the drf-yasg branch for OpenAPI3 has been stale for a while now.
We literally found ourselves in the same situation as @Behoston in #7205. Initially, I was super stoked when I saw that OpenAPI3 generation was released in 3.10, but soon found out that it was more or less in a "pre-beta" state. Don't get me wrong, I love DRF and deeply appreciate all the hard volunteer work from everyone. I agree with @carltongibson that it is indeed maturing very nicely, although I would argue that it should not have been officially released in that state yet. This being DRF and all where released code is usually top-notch and not filled with a lot of #TODOs.
Most helpful comment
To @fyhertz @Reshurum @glebovmaksim @stefanitsky @Behoston @dhaval-mehta @lucidiot @fangaofeng @auvipy @jgadelange @carltongibson and other who might have been interested in this.
We proposed massive changes to the schema generation, but only some parts got accepted. Indeed our PR #7089 was way to big and decomposing it (while retaining the functionality) was quite challenging.
In the end one of our core mechanics (#7096) got rejected in favor of #7124. Since this did not allow for the flexibility we required, we had to go another route.
For that reason we released our approach to schema generation as standalone package
drf-spectacularhttps://github.com/tfranzel/drf-spectacular. Since the PR we did a lot more improvements so check it if you like. Happy for any PRs, suggestions & comments.