Package: djagger
Automated OpenAPI documentation generator for Django. Djagger provides you with a clean and straightforward way to generate a comprehensive API documentation of your Django project by utilizing pydantic to create schema objects for your views.Example Django project using Djagger:https://github.com/royhzq/djagger-exampleGenerated API documentation from the example project:https://djagger-example.netlify.app/Djagger repo:https://github.com/royhzq/djaggerFull Documentation:https://djagger-docs.netlify.appDjagger is designed to be:🧾Comprehensive- Every aspect of your API should be document-able straight from your views, to the full extent of the OpenAPi 3.0 specification.👐Unintrusive- Integrate easily with your existing Django project. Djagger can document vanilla Django views (function-based and class-based views), as well as any Django REST framework views. As long as you are using Django’s default URL routing, you are good to go. You do not need to redesign your APIs for better documentation.🍭Easy- Djagger uses pure, unadulterated pydantic models to generate schemas. If you have used pydantic, there is no learning curve. If you have not heard of pydantic, it is a powerful data validation library that is pretty straightforward to pickup (like dataclasses).Check it out here. Either way, documenting your APIs will feel less like a chore.QuickstartInstall usingpippipinstalldjaggerAdddjaggerto yourINSTALLED_APPSsetting in your Django project like this:INSTALLED_APPS=[...'djagger',]Include the djagger URLconf in your projecturls.pylike this if you want to use the built-in document views.urlpatterns=[...path('djagger/',include('djagger.urls')),]NoteTo see the generated documentation, use the route/djagger/api/docs. Djagger usesRedocas the default client generator.To get the generated JSON schema file, use the route/djagger/schema.json.ExamplesExample GET Endpointfromrest_framework.viewsimportAPIViewfromrest_framework.responseimportResponsefrompydanticimportBaseModelasSchemaimportdatetimeclassArticleDetailSchema(Schema):created:datetime.datetimetitle:strauthor:strcontent:strclassRandomArticleAPI(APIView):"""Return a random article from the Blog"""response_schema=ArticleDetailSchemadefget(self,request):...returnResponse({})Generated documentationExample POST Endpointfromrest_framework.viewsimportAPIViewfromrest_framework.responseimportResponsefrompydanticimportBaseModelasSchema,FieldimportdatetimeclassArticleDetailSchema(Schema):created:datetime.datetimetitle:strauthor:strcontent:strclassArticleCreateSchema(Schema):"""POST schema for blog article creation"""title:str=Field(description="Title of Blog article")content:str=Field(description="Blog article content")classArticleCreateAPI(APIView):request_schema=ArticleCreateSchemaresponse_schema=ArticleDetailSchemadefpost(self,request):...returnResponse({})Generated documentationFor more involved examples, check out theexample projectand theAPI documentationgenerated from that project.Documentation & SupportRead the full documentation for Djagger:https://djagger-docs.netlify.appThis project is in continuous development. If you have any questions or would like to contribute, please emailroyhung@protonmail.comIf you want to support this project, do give it a ⭐ on github!