Page MenuHomePhabricator

Document how to get OpenAPI spec in JSON format
Closed, DuplicatePublic

Description

We always return YAML at the moment.

Document how the output of /api/schema/ can be changed by passing in different Accept headers:

  • YAML: application/vnd.oai.openapi (also the default)
  • JSON: application/vnd.oai.openapi+json

Event Timeline

It already works, I just had to read the documentation. :)

$ curl -H 'Accept: application/vnd.oai.openapi+json' 'localhost:8000/api/schema/'
{
    "openapi": "3.0.3",
    "info": {
        "title": "Toolhub API",
        "version": "0.0.1",
        "license": {
            "name": "GPL-3.0-or-later",
            "url": "https://www.gnu.org/licenses/gpl-3.0.html"
        }
    },
...
bd808 renamed this task from Make it possible to get OpenAPI spec in JSON format to Document how to get OpenAPI spec in JSON format.Feb 25 2021, 6:59 PM
bd808 added a project: Documentation.
bd808 updated the task description. (Show Details)