MkDocs Material 2014

Note

This example was created using this macro

import yaml
from pathlib import Path
from openapidocs.mk.v3 import OpenAPIV3DocumentationHandler

def define_env(env):
    @env.macro
    def render_openapi_yaml(path):
        return OpenAPIV3DocumentationHandler(
            yaml.safe_load(Path(path).read_text()),
            style="MKDOCS",
        ).write()

Swagger Petstore 1.0.0

License: MIT

Servers

Description URL
http://petstore.swagger.io/v1 http://petstore.swagger.io/v1

pets


GET /pets

List all pets

Input parameters

Parameter In Type Default Nullable Description
limit query integer No How many items to return at one time (max 100)

Response 200 OK

[
    {
        "id": 40,
        "name": "string",
        "tag": "string"
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "maxItems": 100,
    "items": {
        "$ref": "#/components/schemas/Pet"
    }
}

Response headers

Name Description Schema
x-next A link to the next page of responses string

Other responses

{
    "code": 259,
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "required": [
        "code",
        "message"
    ],
    "properties": {
        "code": {
            "type": "integer",
            "format": "int32"
        },
        "message": {
            "type": "string"
        }
    }
}

POST /pets

Create a pet

Request body

{
    "id": 54,
    "name": "string",
    "tag": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "required": [
        "id",
        "name"
    ],
    "properties": {
        "id": {
            "type": "integer",
            "format": "int64"
        },
        "name": {
            "type": "string"
        },
        "tag": {
            "type": "string"
        }
    }
}

Response 201 Created

Other responses

{
    "code": 173,
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "required": [
        "code",
        "message"
    ],
    "properties": {
        "code": {
            "type": "integer",
            "format": "int32"
        },
        "message": {
            "type": "string"
        }
    }
}

GET /pets/{petId}

Info for a specific pet

Input parameters

Parameter In Type Default Nullable Description
petId path string No The id of the pet to retrieve

Response 200 OK

{
    "id": 88,
    "name": "string",
    "tag": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "required": [
        "id",
        "name"
    ],
    "properties": {
        "id": {
            "type": "integer",
            "format": "int64"
        },
        "name": {
            "type": "string"
        },
        "tag": {
            "type": "string"
        }
    }
}

Other responses

{
    "code": 221,
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "required": [
        "code",
        "message"
    ],
    "properties": {
        "code": {
            "type": "integer",
            "format": "int32"
        },
        "message": {
            "type": "string"
        }
    }
}

Schemas

Error

Name Type
code integer(int32)
message string

Pet

Name Type
id integer(int64)
name string
tag string

Pets

Type: Array<Pet>

search