简体   繁体   中英

Documenting Django Rest Framework API

Looking for self describing api for django rest framework application

We are using Django 2 and Django Rest Framework 3.7.3 We are looking to document the api based on view doc strings or meta-data I have tried drf docs and drf auto docs and there don't seem to support our app Someone mentioned pydocs, but don't think this will work Our worse case would be using Sphinx I think

we would like an api that gives an example ideally

Example request:

GET /tests HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json
[
    {
        "name": "test1",

    },
    {
        "name": "test2",

    }
]

Status Codes:

200 OK – List of a tests.

您可以尝试drf-yasg ,它支持生成redoc或swagger文档。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM