Swagger for Django api

This page summarizes the projects mentioned and recommended in the original post on /r/django

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • drf-yasg

    Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.

  • I believe drf-yasg what you need. You can create a schema manually and define request and response types for your small API.

  • I did this in one of my projects: https://gitlab.com/mrswats/config-server/-/commit/b5dac490bc3e12a6d4f2090b11b3616b82aaf300

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • drf-spectacular

    Sane and flexible OpenAPI 3 schema generation for Django REST framework.

  • I would suggest drf-spectacular instead because https://github.com/axnsan12/drf-yasg#openapi-30-note

  • swagger-ui

    Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

  • Then you need a html file that loads swagger-ui and points towards your openapi.json file from the previous step. Look at the unpkg example here for the easiest way to set one up. Either hard code the url in the file or serve it as a django template that fills in the correct value.

  • swagger-editor

    Swagger Editor

  • Sure. You can use the editor from here for instance to define your endpoints and the data received and returned. By looking at the preloaded example you can figure out most of what you need to know about openapi. But if you need more info, the official documentation is pretty good.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts