-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
OpenAPI 3.0 should generate and reference #/components/schemas/ #6984
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
Comments
Yes. This would be a great a addition. A super contributing opportunity! |
Is the following considered a supported DRF use case? |
Not "supported" no. 🙂 We'd need logic to go from serializers/models to component definitions, and then operations would need to reference those. |
I started implementing this over here: django-json-api/django-rest-framework-json-api#689. I've been sort of on hold with this, with feedback being some of the stuff I did would best be implemented upstream here. However, I've been busy with other stuff at work lately. Feel free to use anything useful you see there. Most of the relevant code is in openapi.py |
Super. Good stuff @n2ygk! Thanks for your efforts. |
I'd love to have this feature. @n2ygk you mentioned that you were working on an implementation for this over in another project. Do you have an idea of the efforts needed to get that code back into drf? Hopefully I'd be able to dedicate some time to this. |
I just made a PR for this issue. It's working without issue on our large codebase. Feel free to give it a try ;) |
Checklist
master
branch of Django REST framework.Steps to reproduce
Swagger 2.0 supports the concept of a definition #/definitions/{ModelName}. This is superseded in OpenAPI 3.0 with #/components/schemas/{ModelName}
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: