rawmind/express-autodoc

View on GitHub
examples/singleApp/swagger_output.json

Summary

Maintainability
Test Coverage
{
  "swagger": "2.0",
  "host": "localhost",
  "schemes": [
    "http"
  ],
  "security": [
    {
      "ApiKeyAuth": [],
      "OrgHeader": []
    }
  ],
  "paths": {
    "/api/v1/songs": {
      "get": {
        "description": "Get songs",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "The song title",
            "default": "Sad but true"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "produces": [
          "application/json",
          "application/xml"
        ]
      }
    },
    "/api/v1/song/{id}": {
      "get": {
        "description": "Get song by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "description": "Updates a new song",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/song-json": {
      "post": {
        "description": "Updates a new song",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object",
              "example": "{\"json\": \"body\"}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/song/{id}/*": {
      "put": {
        "description": "Updates a new song",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "patch": {
        "description": "Partial updates for a song",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "trace": {
        "description": "Some other stuff (trace)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "head": {
        "description": "Some other stuff (head)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The song id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v3/song-json": {
      "post": {
        "description": "Updates a new song",
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Song"
            }
          }
        ],
        "responses": {
          "200": {
            "content": "application/json",
            "description": "OK",
            "schema": {
                   "$ref": "#/definitions/Song"
            }
          }
        }
      }
    }
  }
}